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

From Joshua D. Drake
Subject Returning multiple columns with a function??
Date
Msg-id 3DFE5823.7090003@commandprompt.com
Whole thread Raw
Responses Re: Returning multiple columns with a function??
Re: Returning multiple columns with a function??
Re: Returning multiple columns with a function??
List pgsql-general
Hello,

   We are starting to test 7.3 for Mammoth (we always test a release
behind) and are having some problems understanding what the exact
features limitations of the new table functionality is. Specifically
in the announce (and talked about ALOT) is:

Table Functions
         PostgreSQL version 7.3 has greatly simplified returning result
sets of rows and columns in database functions.  This significantly
enhances the useability of stored procedures in PostgreSQL, and will
make it even easier to port Oracle applications to PostgreSQL.


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

What are we missing?

Sincerley,

Joshua Drake

--
<COMPANY>CommandPrompt    - http://www.commandprompt.com    </COMPANY>
<CONTACT>       <PHONE>+1.503.222-2783</PHONE>          </CONTACT>


pgsql-general by date:

Previous
From: Brian Hirt
Date:
Subject: Re: 7.3 backend crash
Next
From: "Gavin M. Roy"
Date:
Subject: ORDER BY random() LIMIT 1 slowness