Peter Eisentraut wrote:
> Am Montag, 5. September 2005 11:42 schrieb Alban Hertroys:
>
>>Reading up on ECPG, I figured it would be nice to be able to use that in
>>stored procedures.
>
>
> The purpose of ECPG is to provide a smooth interface for hooking in SQL calls
> into C programs. If you want to have that kind of smoothness for stored
> procedures, then don't write them in C in the first place. You may find that
> PL/pgSQL gives you a very similar interface to ECPG.
We did so far, but we're looking into getting a better performance out
of some of our stored procedures. There are a number that happily
cascade away that could probably be a bit faster. I realize C or
PL/PGSQL won't make much difference if the SPI is basically just doing
queries, but there are some that do various types of math.
The "problem" with calling libpq functions directly is that a small
mistake allocating or freeing a variable is made easily - eventually
resulting in de database server crashing (does it? Our sysadmin says so,
but...). It looks like ECPG could take a lot of that risc away, and make
programming easier along the way.
Next to that, the very similar interface is exactly why I would like to
use ECPG. It could cut down development times.
If it's not possible to use ECPG for this, too bad. Then we'll have to
try with libpq (I doubt my boss would give us time to create a free
implementation of a PL/ECPG or something along the lines). I'd just like
to know...
Regards,
--
Alban Hertroys
alban@magproductions.nl
magproductions b.v.
T: ++31(0)534346874
F: ++31(0)534346876
M:
I: www.magproductions.nl
A: Postbus 416
7500 AK Enschede
//Showing your Vision to the World//