Re: Returning multiple columns with a function??

From: Eric B(dot)Ridge <ebr(at)tcdi(dot)com>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Returning multiple columns with a function??
Date: 2002-12-16 22:59:22
Message-ID: 044343FE-114A-11D7-AAD7-0003937E3354@tcdi.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gavin M. Roy 2002-12-16 23:00:03 ORDER BY random() LIMIT 1 slowness
Previous Message Joshua D. Drake 2002-12-16 22:48:03 Returning multiple columns with a function??