From ccc01224dae4926a7b4f65e719045d23abec2e49 Mon Sep 17 00:00:00 2001 From: Stevan Earl Date: Thu, 13 Aug 2026 10:46:41 -0700 Subject: [PATCH] Qualify external-table fields in trigger errors --- .../lib/triggers/create/biography_data.m4 | 38 +++++++++---------- db/schemas/lib/triggers/create/events.m4 | 14 +++---- db/schemas/lib/triggers/create/roles.m4 | 10 ++--- 3 files changed, 31 insertions(+), 31 deletions(-) diff --git a/db/schemas/lib/triggers/create/biography_data.m4 b/db/schemas/lib/triggers/create/biography_data.m4 index 7ea6816..83e2916 100644 --- a/db/schemas/lib/triggers/create/biography_data.m4 +++ b/db/schemas/lib/triggers/create/biography_data.m4 @@ -348,9 +348,9 @@ CREATE OR REPLACE FUNCTION biography_data_func () || NEW.animname || '), Value (BirthDate) = (' || NEW.birthdate - || '), Key (CommMID) = (' + || '), Key (COMM_MEMBS.CommMID) = (' || commmid - || '), Value (StartDate) = (' + || '), Value (COMM_MEMBS.StartDate) = (' || startdate || ')'; END IF; @@ -425,9 +425,9 @@ CREATE OR REPLACE FUNCTION biography_data_func () || NEW.animname || '), Value (DepartDate) = (' || NEW.departdate - || '), Key (CommMID) = (' + || '), Key (COMM_MEMBS.CommMID) = (' || commmid - || ') Value (EndDate) = (' + || ') Value (COMM_MEMBS.EndDate) = (' || enddate || ')'; END IF; @@ -529,11 +529,11 @@ CREATE OR REPLACE FUNCTION biography_data_func () || NEW.departdate || ': Key (WATCHES.WID) = (' || a_wid - || '), Value (Date) = (' + || '), Value (WATCHES.Date) = (' || a_date - || '), Value (Type) = (' + || '), Value (WATCHES.Type) = (' || a_type - || '), Value (CommID) = (' + || '), Value (WATCHES.CommID) = (' || a_commid || ')'; END IF; @@ -684,17 +684,17 @@ CREATE OR REPLACE FUNCTION biography_data_func () || a_reid || '), Value (REPRO_STATES.Date) = (' || a_date - || '), Value (State) = (' + || '), Value (REPRO_STATES.State) = (' || a_state - || '), Value (Source) = (' + || '), Value (REPRO_STATES.Source) = (' || a_source - || '), Value (EstrusDay) = (' + || '), Value (REPRO_STATES.EstrusDay) = (' || textualize(`a_estrusday') - || '), Value (EstrusDayCert) = (' + || '), Value (REPRO_STATES.EstrusDayCert) = (' || a_estrusdaycert - || '), Value (LactEndCert) = (' + || '), Value (REPRO_STATES.LactEndCert) = (' || a_lactendcert - || '), Value (Parity) = (' + || '), Value (REPRO_STATES.Parity) = (' || a_parity || ')'; END IF; @@ -726,17 +726,17 @@ CREATE OR REPLACE FUNCTION biography_data_func () || a_reid || '), Value (REPRO_STATES.Date) = (' || a_date - || '), Value (State) = (' + || '), Value (REPRO_STATES.State) = (' || a_state - || '), Value (Source) = (' + || '), Value (REPRO_STATES.Source) = (' || a_source - || '), Value (EstrusDay) = (' + || '), Value (REPRO_STATES.EstrusDay) = (' || textualize(`a_estrusday') - || '), Value (EstrusDayCert) = (' + || '), Value (REPRO_STATES.EstrusDayCert) = (' || a_estrusdaycert - || '), Value (LactEndCert) = (' + || '), Value (REPRO_STATES.LactEndCert) = (' || a_lactendcert - || '), Value (Parity) = (' + || '), Value (REPRO_STATES.Parity) = (' || a_parity || ')'; END IF; diff --git a/db/schemas/lib/triggers/create/events.m4 b/db/schemas/lib/triggers/create/events.m4 index 5cdc01b..83b2d85 100644 --- a/db/schemas/lib/triggers/create/events.m4 +++ b/db/schemas/lib/triggers/create/events.m4 @@ -113,7 +113,7 @@ CREATE OR REPLACE FUNCTION events_func () , DETAIL = 'Events with (Behavior) = (' || NEW.behavior || ') cannot be related to a WATCHES row with' - || ' (Type) = (' + || ' (WATCHES.Type) = (' || a_type || '): Key (EID) = (' || NEW.eid @@ -342,17 +342,17 @@ CREATE OR REPLACE FUNCTION events_delete_commit_func () || ' with a Seq of (' || a_seq - 1 || ') to pair with the following ARRIVALS row:' - || ' Key (EID) = (' + || ' Key (ARRIVALS.EID) = (' || a_eid - || '): Value (Seq) = (' + || '): Value (ARRIVALS.Seq) = (' || a_seq - || '): Value (NestStart) = (' + || '): Value (ARRIVALS.NestStart) = (' || a_neststart - || '): Value (NestEnd) = (' + || '): Value (ARRIVALS.NestEnd) = (' || a_nestend - || '): Value (Swelling) = (' + || '): Value (ARRIVALS.Swelling) = (' || a_swelling - || '): Value (DataSource) = (' + || '): Value (ARRIVALS.DataSource) = (' || a_datasource || '): Key (ROLES.PID) = (' || a_pid diff --git a/db/schemas/lib/triggers/create/roles.m4 b/db/schemas/lib/triggers/create/roles.m4 index d148445..53b1dad 100644 --- a/db/schemas/lib/triggers/create/roles.m4 +++ b/db/schemas/lib/triggers/create/roles.m4 @@ -656,15 +656,15 @@ CREATE OR REPLACE FUNCTION roles_delete_func () || a_type || '), Value (WATCHES.CommID) = (' || a_commid - || '), Key (EID) = (' + || '), Key (ARRIVALS.EID) = (' || a_eid - || '), Value (Seq) = (' + || '), Value (ARRIVALS.Seq) = (' || a_seq - || '), Value (NestStart) = (' + || '), Value (ARRIVALS.NestStart) = (' || a_neststart - || '), Value (NestEnd) = (' + || '), Value (ARRIVALS.NestEnd) = (' || a_nestend - || '), Value (Swelling) = (' + || '), Value (ARRIVALS.Swelling) = (' || a_swelling || ')' , HINT = 'To delete this row, use a transaction and' -- 2.34.1