diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2001-11-12 00:00:55 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2001-11-12 00:00:55 +0000 |
commit | 8bfc437301d5ac1a209349b4c9e466b798e5b90a (patch) | |
tree | 0556ffc88d7c78517ad881a9483a598ba43ed748 /src/backend/commands/trigger.c | |
parent | 801a1acccaba8fca5ad5d09132126bd51a1dca2d (diff) | |
download | postgresql-8bfc437301d5ac1a209349b4c9e466b798e5b90a.tar.gz postgresql-8bfc437301d5ac1a209349b4c9e466b798e5b90a.zip |
Clean up a bunch of ScanKeyEntryInitialize calls that weren't bothering
to apply the proper Datum conversion macros to search key values.
Diffstat (limited to 'src/backend/commands/trigger.c')
-rw-r--r-- | src/backend/commands/trigger.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/backend/commands/trigger.c b/src/backend/commands/trigger.c index e108840d780..3847d92e5fc 100644 --- a/src/backend/commands/trigger.c +++ b/src/backend/commands/trigger.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/trigger.c,v 1.97 2001/10/25 05:49:25 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/trigger.c,v 1.98 2001/11/12 00:00:55 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -145,7 +145,8 @@ CreateTrigger(CreateTrigStmt *stmt) */ tgrel = heap_openr(TriggerRelationName, RowExclusiveLock); ScanKeyEntryInitialize(&key, 0, Anum_pg_trigger_tgrelid, - F_OIDEQ, RelationGetRelid(rel)); + F_OIDEQ, + ObjectIdGetDatum(RelationGetRelid(rel))); tgscan = heap_beginscan(tgrel, 0, SnapshotNow, 1, &key); while (HeapTupleIsValid(tuple = heap_getnext(tgscan, 0))) { @@ -327,7 +328,8 @@ DropTrigger(DropTrigStmt *stmt) */ tgrel = heap_openr(TriggerRelationName, RowExclusiveLock); ScanKeyEntryInitialize(&key, 0, Anum_pg_trigger_tgrelid, - F_OIDEQ, RelationGetRelid(rel)); + F_OIDEQ, + ObjectIdGetDatum(RelationGetRelid(rel))); tgscan = heap_beginscan(tgrel, 0, SnapshotNow, 1, &key); while (HeapTupleIsValid(tuple = heap_getnext(tgscan, 0))) { @@ -398,7 +400,8 @@ RelationRemoveTriggers(Relation rel) tgrel = heap_openr(TriggerRelationName, RowExclusiveLock); ScanKeyEntryInitialize(&key, 0, Anum_pg_trigger_tgrelid, - F_OIDEQ, RelationGetRelid(rel)); + F_OIDEQ, + ObjectIdGetDatum(RelationGetRelid(rel))); tgscan = heap_beginscan(tgrel, 0, SnapshotNow, 1, &key); @@ -450,7 +453,8 @@ RelationRemoveTriggers(Relation rel) * Also drop all constraint triggers referencing this relation */ ScanKeyEntryInitialize(&key, 0, Anum_pg_trigger_tgconstrrelid, - F_OIDEQ, RelationGetRelid(rel)); + F_OIDEQ, + ObjectIdGetDatum(RelationGetRelid(rel))); tgscan = heap_beginscan(tgrel, 0, SnapshotNow, 1, &key); while (HeapTupleIsValid(tup = heap_getnext(tgscan, 0))) @@ -585,12 +589,6 @@ RelationBuildTriggers(Relation relation) build->tgnargs = pg_trigger->tgnargs; memcpy(build->tgattr, &(pg_trigger->tgattr), FUNC_MAX_ARGS * sizeof(int16)); - val = (struct varlena *) fastgetattr(htup, - Anum_pg_trigger_tgargs, - tgrel->rd_att, &isnull); - if (isnull) - elog(ERROR, "RelationBuildTriggers: tgargs IS NULL for rel %s", - RelationGetRelationName(relation)); if (build->tgnargs > 0) { char *p; |