Hello From: Kristjan Tammekivi <kristjantammekivi@xxxxxxxxx> Hi, I've noticed a change in the behaviour in triggers / hstores in Postgres 11.1 when compared to Postgres 10.5. The following won't work on Postgres 10.5 but in Postgres 11.1 it works just fine: CREATE EXTENSION hstore; INSERT INTO _tmp_test1 (val) VALUES (5); ERROR: record "old" is not assigned yet DETAIL: The tuple structure of a not-yet-assigned record is indeterminate. CONTEXT: SQL statement "INSERT INTO _tmp_test1_changes (id, changes) VALUES (NEW.id, hstore(OLD) - hstore(NEW))" PL/pgSQL function test1_trigger() line 3 at SQL statement I couldn't find anything about this in the release notes (https://www.postgresql.org/docs/11/release-11.html), but maybe I just didn't know what to look for. I doubt that this works on any PG version for INSERT. According to the documentation: https://www.postgresql.org/docs/10/plpgsql-trigger.html and https://www.postgresql.org/docs/11/plpgsql-trigger.html OLD: Data type RECORD; variable holding the old database row for UPDATE/DELETE operations in row-level triggers. This variable is unassigned in statement-level triggers and for INSERT operations. Regards Charles |