cockroachdb / cockroachdb/cockroach

sql: aggregate functions are not allowed in a recursive query's recursive term

Open
#113,625 2 comments 0 reactions 0 assignees View on GitHub
C-bug O-pg-regress T-sql-queries
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

The following query fails in postgres with the error "aggregate functions are not allowed in a recursive query's recursive term":

```
WITH RECURSIVE x(n) AS (SELECT 1 UNION ALL SELECT count(*) FROM x) SELECT * FROM x;
```

In CRDB, this does not result in an error, and thus never terminates.

Found using pg_regress.

Jira issue: CRDB-33077

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.