From: Kristo Kaiv <kristo.kaiv@skype.net>
To: Postgresql General List <pgsql-general@postgresql.org>
Subject: table column vs. out param [1:0]
Date: Thu, 23 Aug 2007 08:51:36 +0300
Message-ID: <5177DE35-7DAD-4DAF-B314-242DAA2B15D1@skype.net> (raw)
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)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: kristo.kaiv@skype.net, pgsql-general@postgresql.org
Subject: Re: table column vs. out param [1:0]
In-Reply-To: <5177DE35-7DAD-4DAF-B314-242DAA2B15D1@skype.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox