"David G. Johnston" <david.g.johnston@xxxxxxxxx> writes: > On Wed, Mar 23, 2022 at 10:10 AM Viliam Ďurina <viliam.durina@xxxxxxxxx> > wrote: >> Now I'm surprised that a set-returning function is even allowed in SELECT >> clause where the values have to be scalar. > AFAIK the lateral construct, which is required to avoid doing just this, is > a relatively recent invention for SQL. I infer from that fact that the > ability to execute a set-returning function in the select clause has always > been allowed. I believe that Postgres' handling of that is actually a hangover from Berkeley's PostQUEL language. Dunno what the SQL standard has to say on the subject --- but it wouldn't surprise me if they don't allow it. regards, tom lane