Search Postgresql Archives

Re: type bug?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tuesday, October 5, 2021, <ml@xxxxxxx> 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.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux