"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:  NEW used in query that is not in a rule

I agree that this error message is pretty unhelpful, but the code is
wrong anyway.  The correct way to do this is
        PERFORM COALESCE((NEW.some_composite_field).field, TRUE);

                        regards, tom lane

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Reply via email to