Re: plpgsql - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: plpgsql
Date
Msg-id 20031019212556.GB32744@dcc.uchile.cl
Whole thread Raw
In response to plpgsql  (Martin Marques <martin@bugs.unl.edu.ar>)
Responses Re: plpgsql  (Martin Marques <martin@bugs.unl.edu.ar>)
List 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;'
languageplpgsql; 
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)

pgsql-general by date:

Previous
From: Gaetano Mendola
Date:
Subject: Re: VACUUM degrades performance significantly. Database
Next
From: Stephan Szabo
Date:
Subject: Re: convert string function and built-in conversions