Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.2k views
in Technique[技术] by (71.8m points)

amazon redshift - Invalid operation: WITH RECURSIVE is not supported

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;
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The official Amazon Redshift documentation: Unsupported PostgreSQL Features:

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...