Re: [GENERAL] Trigger documentation? Need more examples.. pleeeze.. ; -)

From: "amy cheng" <amycq(at)hotmail(dot)com>
To: pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] Trigger documentation? Need more examples.. pleeeze.. ; -)
Date: 1999-08-20 08:01:21
Message-ID: 19990820150122.91061.qmail@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

It is possible. But I do not know how :-) I Know it because PL/pgSQL
can do it, and spi/C can do more than PL/pgSQL.

in the doc, seems a lot stuff on spi (server programming interface ?).

also, since the syntax of PL/pgSQL is not difficult at all, it can
serve as the psudo-code for most purpose, even if you prefer spi/c .

If you want to handle external stuff, seems only by spi/C --
ok, I'm a newbie myself, so, anybody can confirm this? and How to
do this by c? (I'm doing it outside the db, quick-dirty approach!)

amy

>From: Henrique Pantarotto <scanner(at)cepa(dot)com(dot)br>
>To: Zakkr <zakkr(at)zf(dot)jcu(dot)cz>
>CC: pgsql-general(at)postgreSQL(dot)org
>Subject: Re: [GENERAL] Trigger documentation? Need more examples..
>pleeeze.. ;-)
>Date: Fri, 20 Aug 1999 09:44:40 -0300
>
>Zakkr,
>
>I wonder if you read my message. I am aware of the examples in the
>contrib/spi
>directory, but they aren't enough for me. I'm looking for a more specific
>trigger documentation, or more trigger examples.
>
>I would like to know how, from a trigger C function, can I get the "old"
>and
>"new" value for an updated field. Is this possible? How do I do that?
>
>For example, if I do:
>
>update users set username = "clinton" where id = "2400"
>
>When the trigger is activated, is it possible to compare the OLD value and
>NEW
>value of the field "username"?
>
>Did you understand? ;-)
>
>Thanks!
>
> > > I'm new to PostgreSQL, but I've been using MySQL/mSQL for a long time
>now.
> I > > switched to PostgreSQL mostly because of it's features: triggers,
>specially. > >
> >
> > Trigger examples ... why not:
> > ..see a /postgresql-6.5.1/contrib/spi directory in PostgreSQL source
>package.
> >
> > Zakkr
>--
>Henrique Pantarotto
>CEPAnet Internet Provider
>webmaster / analista de sistemas
>Email: scanner(at)cepa(dot)com(dot)br
>Tel: (011) 5506-8477
>Cel: (011) 9706-3444
>LINUX FRIEND
>
>************
>
>

_______________________________________________________________
Get Free Email and Do More On The Web. Visit http://www.msn.com

Browse pgsql-general by date

  From Date Subject
Next Message Jérome Knöbl 1999-08-20 08:04:24 Re: [GENERAL] Huge backends / self joins / long queries
Previous Message Sofian Lutfi 1999-08-20 06:29:11 subscribe