Search Postgresql Archives

Re: create type with %type or %rowtype

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

 



Hi,

> On 18. Nov, 2020, at 22:08, Post Gresql <postgresql@xxxxxxxxxxx> wrote:
> 
> I might be stupid, but where in the document for create function does it say that the return type can be a table?
> 
> From the doc for version 13 https://www.postgresql.org/docs/13/sql-createfunction.html
> 
> "rettype
> The return data type (optionally schema-qualified). The return type can be a base, composite, or domain type, or can reference the type of a table column."

right in the syntax:

CREATE [ OR REPLACE ] FUNCTION
    name ( [ [ argmode ] [ argname ] argtype [ { DEFAULT | = } default_expr
 ] [, ...] ] )
    [ RETURNS rettype
      | RETURNS TABLE ( column_name column_type [, ...] ) ]

"RETURNS TABLE(...)" is probably what you're looking for?

Cheers,
Paul





[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 Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux