Search Postgresql Archives

Re: plpgsql: returning multiple named columns from function

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

 



John Lawler <postgresql.org@xxxxxxxxx> writes:
> Plus, the main part was to be able to have the columns (arbitrarily) 
> named as if they'd been selected from a table.  I hope that there's 
> something about as easy as the example I cited from MS SQL.

In existing releases you need to create a named composite type (row
type) and declare the function as returning that type.  PG 8.1 will
provide some syntactic sugar for this in the form of OUT parameters.
There are examples in the docs ...

			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

[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