无效操作:不支持使用递归



当我在下面运行查询时,我收到消息:

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

有人可以解释为什么递归函数不起作用吗?(我正在研究亚马逊红移(

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;

Amazon Redshift 官方文档: 不支持的 PostgreSQL 功能:

Amazon Redshift 不支持这些 PostgreSQL 功能。


- 递归公用表表达式
...

从2021 年 4 月 29 日起,Redshift 现在支持WITH RECURSIVE

  • https://aws.amazon.com/about-aws/whats-new/2021/04/amazon-redshift-announces-support-for-heirarchical-data-queries-with-recursive-cte/
  • https://docs.aws.amazon.com/redshift/latest/dg/r_WITH_clause.html#r_WITH_clause-recursive-cte

最新更新