Re: [SQL] Triggers using PL/pgSQL

2006-07-31 Thread George Weaver
- Original Message - From: Aaron Bono To: John DeSoi I don't think so but there was some discussion a week or two ago about mixing variables and using execute. I am curious, does anyone >know what the "best" approach is? Also, I did not address deletions. If you still need to d

Re: [SQL] Triggers using PL/pgSQL

2006-07-31 Thread Milen A. Radev
Thusitha Kodikara написа: > Hello, > > I am interested in developing some triggers to keep track of records that are > changed (possibly the changes of one or more specific columns). In addition > to keeping the new values, I also need to keep the old values (may be on a > separate table). >

Re: [SQL] Triggers using PL/pgSQL

2006-07-31 Thread Ken Hill
On Sun, 2006-07-30 at 21:16 -0700, Thusitha Kodikara wrote: > Hello, > > I am interested in developing some triggers to keep track of records > that are changed (possibly the changes of one or more specific > columns). In addition to keeping the new values, I also need to keep > the old values (ma

Re: [SQL] Triggers using PL/pgSQL

2006-07-31 Thread John DeSoi
On Jul 31, 2006, at 10:59 AM, Aaron Bono wrote: On 7/31/06, John DeSoi <[EMAIL PROTECTED]> wrote: Is it really necessary to build a SQL string and use execute? It seems you could just issue the INSERT statement. I don't think so but there was some discussion a week or two ago about mixing va

Re: [SQL] Triggers using PL/pgSQL

2006-07-31 Thread Aaron Bono
On 7/31/06, John DeSoi <[EMAIL PROTECTED]> wrote: Is it really necessary to build a SQL string and use execute? Itseems you could just issue the INSERT statement.I don't think so but there was some discussion a week or two ago about mixing variables and using execute.  I am curious, does anyone kno

Re: [SQL] Triggers using PL/pgSQL

2006-07-31 Thread John DeSoi
Is it really necessary to build a SQL string and use execute? It seems you could just issue the INSERT statement. On Jul 31, 2006, at 12:52 AM, Aaron Bono wrote: CREATE OR REPLACE FUNCTION my_table_history_fn () RETURNS SETOF opaque AS ' BEGIN -- if a trigger insert or update operation

Re: [SQL] Triggers using PL/pgSQL

2006-07-30 Thread Aaron Bono
No problem.  I have been meaning to put the same code together for myself but have been putting it off.  It gave me an excuse to stop procrastinating.On 7/31/06, Thusitha Kodikara <[EMAIL PROTECTED]> wrote: Hello,Thanks a lot Aaron for the very quick and simple example. I just checked it on 7.4.5 a

Re: [SQL] Triggers using PL/pgSQL

2006-07-30 Thread Thusitha Kodikara
Hello,Thanks a lot Aaron for the very quick and simple example. I just checked it on 7.4.5 also and it worked. I'll be able to continue with my development using  the syntax of that example.Regards,-ThusithaAaron Bono <[EMAIL PROTECTED]> wrote: On 7/30/06, Thusitha Kodikara <[EMAIL PROTECTED]> wrot

Re: [SQL] Triggers using PL/pgSQL

2006-07-30 Thread Aaron Bono
On 7/30/06, Thusitha Kodikara <[EMAIL PROTECTED]> wrote: Hello,I am interested in developing some triggers to keep track of records that are changed (possibly the changes of one or more specific columns). In addition to keeping the new values, I also need to keep the old values (may be on a separat

[SQL] Triggers using PL/pgSQL

2006-07-30 Thread Thusitha Kodikara
Hello,I am interested in developing some triggers to keep track of records that are changed (possibly the changes of one or more specific columns). In addition to keeping the new values, I also need to keep the old values (may be on a separate table).  Though I  have done similar things in other RD