Re: Fwd: Start up question about triggers

From: "Forums (at) Existanze" <forums(at)existanze(dot)com>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Fwd: Start up question about triggers
Date: 2006-06-23 07:15:22
Message-ID: 200606230715.k5N7FHjO007409@auth-smtp.hol.gr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


Hello again aaron,

Im really interested in the part where you say "generic trigger" can you
give me some tips? As to how I will go about that? I had already read the
links that Richard gave, I new I could get the values like that. So right
now I will have to create a trigger for each of my tables to create the
necessary queries, or I could do it "generically" :-)

Best Regards,
Fotis

> -----Original Message-----
> From: pgsql-sql-owner(at)postgresql(dot)org
> [mailto:pgsql-sql-owner(at)postgresql(dot)org] On Behalf Of Richard
> Broersma Jr
> Sent: 23 June 2006 08:10
> To: Aaron Bono; pgsql-sql(at)postgresql(dot)org
> Subject: Re: Fwd: [SQL] Start up question about triggers
>
> > I did some research and can't even find a way to get meta
> data in a trigger.
> >
> > In a trigger, is there a way to inspect OLD and NEW to see what
> > columns are there and see what has changed? If so, you may not be
> > able to grab the actual query but you could create a
> generic trigger
> > that reconstructs a possible update/insert/delete for any
> table in your database.
> >
> > Does anyone know of a good place to go get information about using
> > meta data in a stored procedure or trigger?
>
> yes.
> See the section "User Comments" at the very bottom of Chapter
> 33 after "Writing Trigger Functions in C". It is odd that a
> PL_PGSQL example is given at the end a chapter for triggers
> written in C.
>
> http://www.postgresql.org/docs/8.1/interactive/trigger-example.html
>
> Also see the entire chapter 36.10 "Trigger Procedures"
> http://www.postgresql.org/docs/8.1/interactive/plpgsql-trigger.html
>
> Hope this is what you are looking for.
>
> Regards,
>
> Richard Broersma Jr.
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match
>

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message George Weaver 2006-06-23 12:37:41 Re: Fwd: Start up question about triggers
Previous Message Richard Broersma Jr 2006-06-23 05:09:30 Re: Fwd: Start up question about triggers