Bug in plpgsql, when using NEW with composite field value.

From: "Oleg Serov" <serovov(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Bug in plpgsql, when using NEW with composite field value.
Date: 2008-12-10 09:54:27
Message-ID: cec7c6df0812100154h21cd6117sfb98fafb8643c896@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

SQL:

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
QUERY: SELECT COALESCE(NEW.somecompositefield.field, TRUE)
CONTEXT: SQL statement in PL/PgSQL function "bug_with_triggers" near line 2

********** ERROR **********

ERROR: NEW used in query that is not in a rule
SQL state: 42601
Контекст:SQL statement in PL/PgSQL function "bug_with_triggers" near line 2

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Oleg Serov 2008-12-10 10:19:15 plpgsql bug OR future request: Assign fileds in composite subfiled. eg. table.compositefield.subfield := TRUE;
Previous Message Marc Schablewski 2008-12-10 09:51:44 Re: BUG #4565: nextval not updated during wal replication, leading to pk violations