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

From: Henrique Pantarotto <scanner(at)cepa(dot)com(dot)br>
To: "amy cheng" <amycq(at)hotmail(dot)com>
Cc: pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] Trigger documentation? Need more examples.. pleeeze.. ; -)
Date: 1999-08-19 21:06:14
Message-ID: 9908191808070F.00439@scanner.cepa.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Yeah, I really need to do "external stuff" (messing with external files,
executing programs), and if I understood it correctly, PL/pgSQL can't do
that, right?

Thanks!

On qui, 19 ago 1999, you wrote:
> perhaps using PL/pgSQL is easier? in the doc there are examples,
> also, the one in the /test is rather complex (too complex?).
>
> However, PL/pgSQL may not be able to to external stuff, even C
> can do that. -- I have the same problem, anybody'd ideas?
>
>
>
>
> >From: Henrique Pantarotto <scanner(at)cepa(dot)com(dot)br>
> >To: pgsql-general(at)postgreSQL(dot)org
> >Subject: [GENERAL] Trigger documentation? Need more examples.. pleeeze..
> >;-)
> >Date: Thu, 19 Aug 1999 11:40:11 -0300
> >
> >Hello PostgreSQL friends!
> >
> >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.
> >
> >I've studied, compiled and tried the examples from the crontrib/spi
> >directory.
> >They all worked, but without some kind of documentation it is really hard
> >to
> >understand how things really work, and how I can create my own stuff.
> >
> >In the "Programmer's Guide", there's a whole chapter documenting the SPI
> >library, but I didn't find any documentation of the functions directly
> >related
> >to TRIGGERS (library "triggers.h"), like: "TRIGGER_FIRED_BY_UPDATE()",
> >"CurrentTriggerData->tg_newtuple", etc...
> >
> >Is this documentation available somewhere?
> >
> >-----
> >
> >I have this table:
> >
> >CREATE TABLE users (
> > userid INT4 NOT NULL,
> > fullname CHAR(40),
> > username CHAR(20),
> > password CHAR(13)
> >)
> >
> >
> >Using the examples from contrib/spi, I guess I can manage to create an
> >INSERT
> >and DELETE trigger. But I'm not sure how to create an UPDATE one.
> >
> >Let's suppose someone updates both fields "username" and "password". HOW
> >from
> >the trigger I know which fields changed. Is it possible to get the older
> >and newer values and compare them?
> >
> >This UPDATE trigger doesn't need to modify it's own new inserted data, but
> >it
> >has to modify external data (create/delete files at my Linux filesystem,
> >rename directories, etc..).
> >
> >Is such thing possible? Someone has an example of this? ;-)
> >
> >
> >Thanks a lot!
> >
> >Regards from Brazil!
> >
> >
> >--
> >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
--
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

Browse pgsql-general by date

  From Date Subject
Next Message Petter Reinholdtsen 1999-08-19 23:25:54 PostgreSQL order of evaluation
Previous Message Mark Dalphin 1999-08-19 20:46:05 Error during 'vacuum analyze'