Thursday, 23 February 2017

ERROR: Record "OLD" is not assigned yet or ERROR: Record "NEW" is not assigned yet


The following error will get while calling the trigger function by a trigger in postgresql. The trigger function may be using one of these variables OLD and/or NEW.

Error: record "old" is not assigned yet
Error: records "new" is not assigned yet

Solution: Use the "FOR EACH ROW" in your trigger. The OLD and NEW variables are only available for UPDATE operation. Only "NEW" variable is available for INSERT operation. Only "OLD" variable is available for DELETE operation.

No comments:

Post a Comment