Re: pgsql: Doc: improve documentation about composite-value usage. - Mailing list pgsql-committers

From Tom Lane
Subject Re: pgsql: Doc: improve documentation about composite-value usage.
Date
Msg-id 25895.1479870277@sss.pgh.pa.us
Whole thread Raw
In response to Re: pgsql: Doc: improve documentation about composite-value usage.  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-committers
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> ​I found it notable that you choose to introduce the OFFSET 0 hack instead
> of writing a LATERAL query in the "optimization failure" example.​
> SELECT (m).* FROM (SELECT myfunc(x) AS m FROM some_table OFFSET 0) ss;
> instead of​
> SELECT (m).* FROM some_table, LATERAL myfunc(some_table.x) m

Meh ... I'm not really sure that the latter is any less of a hack for this
purpose, or that we'd never optimize it into the unwanted form.  LATERAL
is a good way to fix the weird semantics of set-returning functions in the
tlist, but this is not that case.

            regards, tom lane


pgsql-committers by date:

Previous
From: Robert Haas
Date:
Subject: pgsql: Remove barrier.h
Next
From: Tom Lane
Date:
Subject: pgsql: Make sure ALTER TABLE preserves index tablespaces.