Is possible to use Prepare/Execute inside a function? - Mailing list pgsql-general

From felipe@informidia.com.br
Subject Is possible to use Prepare/Execute inside a function?
Date
Msg-id 4D08F69D.8020408@informidia.com.br
Whole thread Raw
Responses Re: Is possible to use Prepare/Execute inside a function?  (Alban Hertroys <dalroi@solfertje.student.utwente.nl>)
List pgsql-general
Hello, I'm having problems with a function after the postgres server has been upgraded to 8.3.10 (I used 8.3.7). I did some testing and found some strange situations.
------------------------------------------------------------------------------------------------------------
--
not work with the direct call function (worked before the upgrade)
select f_rodar_reportagem(44359, 193097);

--
not work with the call by the trigger (a trigger calls a function and it calls f_rodar_reportagem using select and worked before the upgrade)
update repesportesmt set
       estado = '1'
where idrepesportesmt = 44359;    

-- WORK using Prepare/Execute
prepare rodar(int, int) as select f_rodar_reportagem($1, $2);
execute rodar(44359, 193097);
-------------------------------------------------------------------------------------------------------------

I do not understand why not working after upgrade, but worked with prepare/execute, so I tried to use inside a function but did not work.

-- got error in this line on params
prepare rodar(int, int) as select f_rodar_reportagem($1, $2);



--


Felipe Pamboukian
Analista Programador
Informídia Pesquisas Esportivas Ltda.
Tel./Fax.: 55 11 3673 5566
Email: felipe@informidia.com.br
Web: www.informidia.com.br
Antes de imprimir lembre-se de sua responsabilidade e comprometimento com o Meio Ambiente
Attachment

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: How to restore from backup to 8.4.3 server using 9.0 dump/restore
Next
From: Merlin Moncure
Date:
Subject: Re: Fast Insert and Update (through COPY)