table column vs. out param [1:0]

From: Kristo Kaiv <kristo(dot)kaiv(at)skype(dot)net>
To: Postgresql General List <pgsql-general(at)postgresql(dot)org>
Subject: table column vs. out param [1:0]
Date: 2007-08-23 05:51:36
Message-ID: 5177DE35-7DAD-4DAF-B314-242DAA2B15D1@skype.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

I am trying to implement the new out parameters in functions and
stumbled upon a problem.
There is an internal requirement for our databases that every
function call always returns 2 params status & status_text.
The problem now is that plpgsql selects the out params themselves
into out params instead of function call results that i need there.
If this is the expected behavior of out params it makes using out
params a bit complicated if some table attributes
happen to have the same name as out params. How can i overcome this
situation? I can understand function variables having precedence
over column names as you can freely rename them but out params is a
different situation.

snippet from code
-[cut]--

out status int, -- 200
out status_text text -- OK
) AS $$
BEGIN

-[cut]--
SELECT status, status_text
FROM service._simple_add(
i_key_user
,i_key_service
,i_action
,i_subscr_len)
INTO status, status_text;
-[cut]-

Kristo Kaiv
http://kaiv.wordpress.com (PostgreSQL blog)

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Christian Schröder 2007-08-23 05:54:20 Re: "out of memory" error
Previous Message Oleg Bartunov 2007-08-23 05:27:58 Re: How to switch off Snowball stemmer for tsearch2?

Browse pgsql-sql by date

  From Date Subject
Next Message Kristo Kaiv 2007-08-23 08:11:57 Re: table column vs. out param [1:0]
Previous Message George Pavlov 2007-08-22 15:39:28 minimum bounding circle for a triangle/polygon