Re: Returning multiple columns with a function?? - Mailing list pgsql-general

From Eric B.Ridge
Subject Re: Returning multiple columns with a function??
Date
Msg-id 044343FE-114A-11D7-AAD7-0003937E3354@tcdi.com
Whole thread Raw
In response to Returning multiple columns with a function??  ("Joshua D. Drake" <jd@commandprompt.com>)
List pgsql-general
On Monday, December 16, 2002, at 05:48  PM, Joshua D. Drake wrote:
> <snip>
> But something like this fails:
>
> CREATE OR REPLACE FUNCTION test_multiple () RETURNS SETOF text AS
> 'SELECT ''a'', ''b''' LANGUAGE 'SQL';
> ERROR:  function declared to return text returns multiple columns in
> final SELECT

I think you want:  RETURNS SETOF record as 'select ...'

eric

>
> What are we missing?
>
> Sincerley,
>
> Joshua Drake
>
> --
> <COMPANY>CommandPrompt    - http://www.commandprompt.com    </COMPANY>
> <CONTACT>       <PHONE>+1.503.222-2783</PHONE>          </CONTACT>
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org


pgsql-general by date:

Previous
From: "Gavin M. Roy"
Date:
Subject: ORDER BY random() LIMIT 1 slowness
Next
From: Kevin Brown
Date:
Subject: Re: Total crash of my db-server