Re: plpgsql: returning multiple named columns from function - Mailing list pgsql-general

From Tom Lane
Subject Re: plpgsql: returning multiple named columns from function
Date
Msg-id 21065.1124856936@sss.pgh.pa.us
Whole thread Raw
In response to Re: plpgsql: returning multiple named columns from function  (John Lawler <postgresql.org@tgice.com>)
List pgsql-general
John Lawler <postgresql.org@tgice.com> 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

pgsql-general by date:

Previous
From: Jeff Eckermann
Date:
Subject: Re: ctid access is slow
Next
From: "Jim C. Nasby"
Date:
Subject: Re: ctid access is slow