[GENERAL] Trigger help - updates to column data with null values

2010-03-02 Thread Greg Fischer
Hello all! I do my best to read and google my way around issues, but I seem to be missing something. Probably simple too. So I have a trigger function, in which I'd like to check if a particular column has changed. It works great, unless either the OLD or NEW values are NULL. The purpose is to

Re: [GENERAL] Trigger help - updates to column data with null values

2010-03-02 Thread Craig Ringer
Greg Fischer wrote: Hello all! I do my best to read and google my way around issues, but I seem to be missing something. Probably simple too. So I have a trigger function, in which I'd like to check if a particular column has changed. It works great, unless either the OLD or NEW values

Re: [GENERAL] Trigger help - updates to column data with null values

2010-03-02 Thread Greg Fischer
NICE!!! Worked beautifully! I figured NULL's were not evaluating as a value, but I didn't have the correct operators: these constructs effectively act as though null were a normal data value, rather than “unknown”. I guess I wasn't reading the right part of the manuals! LOL! Thanks so much!

Re: [GENERAL] trigger help

2006-08-23 Thread marcelo Cortez
Michael ,list You are you are right, thanks a lot for your help and tinme. best regards MDC --- Michael Fuhr [EMAIL PROTECTED] escribió: On Tue, Aug 22, 2006 at 02:37:19PM -0300, marcelo Cortez wrote: This isn't a trigger function. Are you sure trigger is the word you meant?

[GENERAL] trigger help

2006-08-22 Thread marcelo Cortez
folks I think my trigger need transaction ,but the pgsql compiler refuse to compile 'begin .. commit ' sequence I use the perform , to do the works i'm wrong? tia. any help be appreciated. MDC code below ( note (*) for perform instruction) CREATE OR REPLACE FUNCTION

Re: [GENERAL] trigger help

2006-08-22 Thread Christopher Browne
On 8/22/06, marcelo Cortez [EMAIL PROTECTED] wrote: I think my trigger need transaction ,but the pgsql compiler refuse to compile 'begin .. commit ' sequence I use the perform , to do the works Stored functions already execute inside the context of some already-running transaction. You don't

Re: [GENERAL] trigger help

2006-08-22 Thread Michael Fuhr
On Tue, Aug 22, 2006 at 10:38:31AM -0300, marcelo Cortez wrote: I think my trigger need transaction ,but the pgsql compiler refuse to compile 'begin .. commit ' sequence I use the perform , to do the works Functions can't start or end transactions because they're already being executed in the

Re: [GENERAL] trigger help

2006-08-22 Thread marcelo Cortez
Micheal This isn't a trigger function. Are you sure trigger is the word you meant? yes i do CREATE TABLE actlocat ( id_actlocal numeric(2) NOT NULL, d_actlocal char(8) NOT NULL, f_novedad float8 NOT NULL, ordenado_por char(18) NOT NULL, CONSTRAINT pk_actlocat PRIMARY KEY

Re: [GENERAL] trigger help

2006-08-22 Thread Michael Fuhr
On Tue, Aug 22, 2006 at 02:37:19PM -0300, marcelo Cortez wrote: This isn't a trigger function. Are you sure trigger is the word you meant? yes i do I see: the function you originally posted is called by a trigger function. In any case the answer is the same: functions can't start or

Re: [GENERAL] Trigger help Solved

2005-07-04 Thread David Pratt
I figured out my trigger trouble: SET lang_code_and_text = r.lang_code_and_text || ARRAY[new.iso_id, default_text] Above was not casting ARRAY[] as text[] so it would not concatenate with existing array - so had to set a variable to cast the type and then concatenate it to original and

[GENERAL] Trigger help

2005-07-03 Thread David Pratt
Basically I want this trigger to work after a language record in my languages table is added. CREATE TRIGGER language_add_trig AFTER INSERT ON languages FOR EACH ROW EXECUTE PROCEDURE trigger_language_add(); Here is my function but it is not working. I am wanting to loop for each