From 201737168c4ed5b14313d111d8d746c7f072f24e Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 19 Apr 2002 16:36:08 +0000 Subject: pg_trigger's index on tgrelid is replaced by a unique index on (tgrelid, tgname). This provides an additional check on trigger name uniqueness per-table (which was already enforced by the code anyway). With this change, RelationBuildTriggers will read the triggers in order by tgname, since it's scanning using this index. Since a predictable trigger ordering has been requested for some time, document this behavior as a feature. Also document that rules fire in name order, since yesterday's changes to pg_rewrite indexing cause that too. --- src/backend/commands/tablecmds.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/backend/commands/tablecmds.c') diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 8abd8cf80de..b0b73af76e4 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/tablecmds.c,v 1.3 2002/04/18 20:01:09 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/tablecmds.c,v 1.4 2002/04/19 16:36:08 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -2909,10 +2909,10 @@ update_ri_trigger_args(Oid relid, if (fk_scan) irel = index_openr(TriggerConstrRelidIndex); else - irel = index_openr(TriggerRelidIndex); + irel = index_openr(TriggerRelidNameIndex); ScanKeyEntryInitialize(&skey[0], 0x0, - 1, /* always column 1 of index */ + 1, /* column 1 of index in either case */ F_OIDEQ, ObjectIdGetDatum(relid)); idxtgscan = index_beginscan(irel, false, 1, skey); -- cgit v1.2.3