Re: Query fails when SRFs are part of FROM clause (Commit id: 69f4b9c85f)
David G. Johnston <david.g.johnston@gmail.com>
From: "David G. Johnston" <david.g.johnston@gmail.com>
To: Rushabh Lathia <rushabh.lathia@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2017-01-27T22:16:38Z
Lists: pgsql-hackers
On Fri, Jan 27, 2017 at 3:13 PM, David G. Johnston <
david.g.johnston@gmail.com> wrote:
> In any case the more idiomatic way of writing your query these days (since
> 9.4 came out) is:
>
> SELECT *
> FROM pg_constraint pc
> LEFT JOIN LATERAL generate_series(1, case when contype in ('f','p','u')
> then array_upper(pc.conkey, 1) else 0 end) gs ON true;
>
>
Supposedly should work back to 9.3, mis-remembered when LATERAL was
released.
David J.
Commits
-
Provide an error cursor for "can't call an SRF here" errors.
- e240a65c7dfc 10.0 landed
-
Pass the source text for a parallel query to the workers.
- 4c728f382970 10.0 cited
-
Move targetlist SRF handling from expression evaluation to new executor node.
- 69f4b9c85f16 10.0 cited