Re: plpgsql

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Martin Marques <martin(at)bugs(dot)unl(dot)edu(dot)ar>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: plpgsql
Date: 2003-10-19 21:25:57
Message-ID: 20031019212556.GB32744@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, Oct 18, 2003 at 06:48:10PM -0300, Martin Marques wrote:
> We are trying to make some things work with plpgsql. The problem is that I
> built several functions that call one another, and I thought that the way of
> calling it was just making the assign:
>
> var:=func1(arg1,arg2);

Have you tried plpgsql's SELECT INTO ?

FWIW this works for me:
alvh=> create function a() returns text as 'select ''foo''::text' language sql;
CREATE FUNCTION

alvh=> create or replace function b() returns text as 'declare b text; begin select into b a(); return b; end;' language plpgsql;
CREATE FUNCTION

alvh=> select b();
b
-----
foo
(1 registro)

alvh=> create or replace function b() returns text as 'declare b text; begin b := a(); return b; end;' language plpgsql;
CREATE FUNCTION
alvh=> select b();
b
-----
foo
(1 registro)

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Por suerte hoy explotó el califont porque si no me habría muerto
de aburrido" (Papelucho)

In response to

  • plpgsql at 2003-10-18 21:48:10 from Martin Marques

Responses

  • Re: plpgsql at 2003-10-20 12:39:00 from Martin Marques

Browse pgsql-general by date

  From Date Subject
Next Message Stephen 2003-10-19 21:37:19 Re: VACUUM degrades performance significantly. Database
Previous Message Gaetano Mendola 2003-10-19 20:02:11 Re: VACUUM degrades performance significantly. Database