Re: How can I get one OLD.* field in a dynamic query inside a trigger function ? - Mailing list pgsql-general

From Pavel Stehule
Subject Re: How can I get one OLD.* field in a dynamic query inside a trigger function ?
Date
Msg-id 162867790910241357m64acc35en5a8c1789f5725911@mail.gmail.com
Whole thread Raw
In response to Re: How can I get one OLD.* field in a dynamic query inside a trigger function ?  (Bruno Baguette <bruno.baguette@gmail.com>)
Responses Re: How can I get one OLD.* field in a dynamic query inside a trigger function ?
List pgsql-general
2009/10/24 Bruno Baguette <bruno.baguette@gmail.com>:
> Le 24/10/09 22:09, Pavel Stehule a écrit :
>>
>> you can use plperl or plpython for this task.
>>
>> Pavel
>
> re-Hello Pavel,
>
> I always used plpgsql because I *thought* it was the most powerfull
> procedural language for stored procedures in PostgreSQL.

plpgsql is best language for stored procedures, but simply it is not
for all. There are some issue still, but some significant limits are
removed in 8.4.

>
> The fact that PL/pgSQL is most documented than PL/Tcl and PL/Perl (and
> PL/Python *seems* to have very poor documentation) has probably made me
> wrong.
>
> Which one would you advise me to learn and use, instead of PL/pgSQL ?

It depends on what you are know (if you known better perl or pthon).
Usually I using mainly plpgsql and on some functions plperl and C.
plpgsql is good language as glue of SQL statements, plperl is good for
IO and CPAN libraries, and C should help with some processor intensive
functions.

>
> Can you explain me why does PL/Perl and PL/Python can does this task (using
> OLD in a dynamic query) where PL/pgSQL can't ?

External procedures (like procedures in plperl or plpython) has not
100% integrated SQL. Next, SQL row is mapped to perl's array and it
should be iterated. Plpgsql is similar to classic programming
languages. In mostly older languages you cannot iterate over
recordset.. plpgsql is static language like C, Pascal, ADA. Perl or
Python are dynamic languages, so you can do some tasks very simple.
And other not, because these languages are only on partially
integrated with SQL.

>
> Once again, thanks a lot for your tips ! :-)

with pleasure

Pavel
>
> Kind regards,
>
> --
> Bruno Baguette - bruno.baguette@gmail.com
>
>

pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: is postgres a good solution for billion record data
Next
From: Tom Lane
Date:
Subject: Re: recovery mode