Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 82F8A9F9DAC for ; Mon, 27 Aug 2007 04:52:47 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 16425-06 for ; Mon, 27 Aug 2007 04:52:43 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from smtp-out.neti.ee (barracuda.neti.ee [194.126.101.113]) by postgresql.org (Postfix) with ESMTP id 3A8919F9D7B for ; Mon, 27 Aug 2007 04:52:43 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by MXR-4.estpak.ee (Postfix) with ESMTP id 29C558EDE; Mon, 27 Aug 2007 10:52:39 +0300 (EEST) X-Virus-Scanned: amavisd-new at !change-mydomain-variable!.example.com Received: from smtp-out.neti.ee ([127.0.0.1]) by localhost (MXR-1.estpak.ee [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RrfxT7O-82Q9; Mon, 27 Aug 2007 10:52:38 +0300 (EEST) Received: from Relayhost2.neti.ee (Relayhost2 [88.196.174.142]) by MXR-4.estpak.ee (Postfix) with ESMTP id EFD5C8ECF; Mon, 27 Aug 2007 10:52:37 +0300 (EEST) Received: from [172.16.32.186] (217-159-130-170-dsl.plus.estpak.ee [217.159.130.170]) by Relayhost2.neti.ee (Postfix) with ESMTP id E537A1DBFCB; Mon, 27 Aug 2007 10:52:39 +0300 (EEST) Mime-Version: 1.0 (Apple Message framework v752.3) In-Reply-To: References: <5177DE35-7DAD-4DAF-B314-242DAA2B15D1@skype.net> Content-Type: multipart/alternative; boundary=Apple-Mail-1--559439331 Message-Id: <6E81C495-5225-4199-BFCB-9EE5FEB1CEF3@skype.net> From: Kristo Kaiv Subject: Re: [GENERAL] table column vs. out param [1:0] Date: Mon, 27 Aug 2007 10:52:38 +0300 To: Albe Laurenz , pgsql-sql@postgresql.org X-Mailer: Apple Mail (2.752.3) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.346 tagged_above=0 required=5 tests=AWL=0.344, BAYES_50=0.001, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200708/214 X-Sequence-Number: 29152 --Apple-Mail-1--559439331 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed On 23.08.2007, at 11:55, Albe Laurenz wrote: > CREATE FUNCTION b(status OUT integer, status_text OUT text) > LANGUAGE plpgsql STABLE STRICT AS > $$DECLARE > RENAME status TO out_status; > RENAME status_text TO out_status_text; > BEGIN > SELECT status, status_text > FROM a() > INTO out_status, out_status_text; > RETURN; > END;$$; > > See > http://www.postgresql.org/docs/current/static/plpgsql- > declarations.html# > PLPGSQL-DECLARATION-RENAMING-VARS > > Yours, > Laurenz Albe From http://www.postgresql.org/docs/current/static/plpgsql- declarations.html#PLPGSQL-DECLARATION-RENAMING-VARS Note: RENAME appears to be broken as of PostgreSQL 7.3. Fixing this is of low priority, since ALIAS covers most of the practical uses of RENAME. Seems to work though. Could somebody please confirm/reject that this has been fixed? Kristo Kaiv http://kaiv.wordpress.com (PostgreSQL blog) --Apple-Mail-1--559439331 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=ISO-8859-1
On 23.08.2007, at = 11:55, Albe Laurenz wrote:
CREATE FUNCTION b(status OUT integer, status_text = OUT text)
=A0 LANGUAGE plpgsql STABLE = STRICT AS
$$DECLARE
=A0=A0 = RENAME status TO out_status;
=A0=A0 RENAME status_text TO = out_status_text;
BEGIN
=A0=A0 = SELECT status, status_text
=A0 =A0 =A0 FROM a()
=A0 =A0 =A0 = INTO out_status, out_status_text;
=A0=A0 RETURN;
END;$$;

See

Yours,
Laurenz Albe


= --Apple-Mail-1--559439331--