Thread: Reading source test of a function

Reading source test of a function

From
"Didier Gasser-Morlay"
Date:
Hello,

I am porting a client application from SQL-Server to PostgreSQL and so
far .. so good. For the record, I am very pleased with the power of
PostgreSQL.

One of the features of this application is the ability to generate
triggers on the fly, sometimes multiple triggers on the same table. so
I have two questions:

1- Is it possible to have several trigger functions called during an
update of one table.

2- Where can I find a function source text in order to display it and
later resubmit it after modifications ?

I have looked in pg_catalog but it is not obvious for a postgreSQL
newbie. Please note that the functions will be written in either SQL
or pgplsql.

thanks in advance

Didier

Re: Reading source test of a function

From
"A. Kretschmer"
Date:
am  Wed, dem 19.12.2007, um 11:29:08 +0100 mailte Didier Gasser-Morlay folgendes:
> Hello,
>
> I am porting a client application from SQL-Server to PostgreSQL and so
> far .. so good. For the record, I am very pleased with the power of
> PostgreSQL.
>
> One of the features of this application is the ability to generate
> triggers on the fly, sometimes multiple triggers on the same table. so
> I have two questions:
>
> 1- Is it possible to have several trigger functions called during an
> update of one table.

Yes, of course.  The triggers fires in alphabetical order, btw.

>
> 2- Where can I find a function source text in order to display it and
> later resubmit it after modifications ?

Table pg_proc, field prosrc.

But don't write directly, use 'create or replace function ...' instead.



Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net