Invalid operation: WITH RECURSIVE is not supported

2019-01-29 00:20发布

When I'm running query below I get message:

[Amazon](500310) Invalid operation: WITH RECURSIVE is not supported;

Can someone explain me why recursive function doesn't work? (I'm working on amazon redshift)

WITH RECURSIVE r AS (
    SELECT 
        1 AS i, 
        1 AS factorial
    UNION 
    SELECT 
        i+1 AS i, 
        factorial * (i+1) as factorial 
    FROM r
    WHERE i < 10
)
SELECT * FROM r;

1条回答
劫难
2楼-- · 2019-01-29 01:06

The official Amazon Redshift documentation: Unsupported PostgreSQL Features:

These PostgreSQL features are not supported in Amazon Redshift.
...
...
- Recursive common table expressions
...

查看更多
登录 后发表回答