Returning multiple columns with a function??

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Returning multiple columns with a function??
Date: 2002-12-16 22:48:03
Message-ID: 3DFE5823.7090003@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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>

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Eric B.Ridge 2002-12-16 22:59:22 Re: Returning multiple columns with a function??
Previous Message Brian Hirt 2002-12-16 22:09:22 Re: 7.3 backend crash