Re: type bug?

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: "ml(at)ft-c(dot)de" <ml(at)ft-c(dot)de>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: type bug?
Date: 2021-10-06 06:10:34
Message-ID: CAKFQuwYkgko2vHc=iXfAqFytCztYoOXyJ_52ewjbcMRtzHusMg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tuesday, October 5, 2021, <ml(at)ft-c(dot)de> wrote:

>
> select * from test_xyz2() ; -- 3 columns, but 1 should be correct?
> select b from test_xyz2() ; -- error
> select x from test_xyz2() ; -- never declared column

All three of these stem from:

https://www.postgresql.org/docs/current/xfunc-sql.html#XFUNC-SQL-TABLE-FUNCTIONS

If the function is defined to return a composite type, the table function
produces a column for each attribute of the composite type.

Table(composite) == “setof composite”. (Though it seems to not be
explicitly documented in that way, it explains the observed behavior)

David J.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2021-10-06 06:14:38 Re: type bug?
Previous Message ml 2021-10-06 06:02:50 Re: type bug?