Re: [BUGS] Bug in plpgsql, when using NEW with composite field value.

2008-12-10 Thread Tom Lane
"Oleg Serov" <[EMAIL PROTECTED]> writes: > CREATE OR REPLACE FUNCTION "bug_with_triggers" () RETURNS trigger AS > $body$ > BEGIN > PERFORM COALESCE(NEW.some_composite_field.field, TRUE); > END; > $body$ > LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER; > Error: > ERROR: N

Re: [BUGS] Bug in plpgsql, when using NEW with composite field value.

2008-12-10 Thread Pavel Stehule
Hello you have to use parenthesis, because parser don't distinguish between variants schema.table.column and variable.field.attrib example: postgres=# create or replace function trgbody() returns trigger as $$ begin raise notice '%', (new.a).a; return new; end $$ language plpgsql; CREATE FUN