diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-11-12 21:15:59 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-11-12 21:15:59 +0000 |
commit | fa5c8a055a02e44f446e4593e397c33a572c4d67 (patch) | |
tree | 9c0a7ded5a88c082c28dbe2b431660813abd72b8 /src/backend/commands/comment.c | |
parent | 49f98fa833407b4e4252e42522e640ec8a0d08b2 (diff) |
Cross-data-type comparisons are now indexable by btrees, pursuant to my
pghackers proposal of 8-Nov. All the existing cross-type comparison
operators (int2/int4/int8 and float4/float8) have appropriate support.
The original proposal of storing the right-hand-side datatype as part of
the primary key for pg_amop and pg_amproc got modified a bit in the event;
it is easier to store zero as the 'default' case and only store a nonzero
when the operator is actually cross-type. Along the way, remove the
long-since-defunct bigbox_ops operator class.
Diffstat (limited to 'src/backend/commands/comment.c')
-rw-r--r-- | src/backend/commands/comment.c | 84 |
1 files changed, 41 insertions, 43 deletions
diff --git a/src/backend/commands/comment.c b/src/backend/commands/comment.c index fbce38ca577..62765a96e0a 100644 --- a/src/backend/commands/comment.c +++ b/src/backend/commands/comment.c @@ -7,7 +7,7 @@ * Copyright (c) 1996-2003, PostgreSQL Global Development Group * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/comment.c,v 1.72 2003/11/09 21:30:36 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/comment.c,v 1.73 2003/11/12 21:15:49 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -156,18 +156,18 @@ CreateComments(Oid oid, Oid classoid, int32 subid, char *comment) /* Use the index to search for a matching old tuple */ - ScanKeyEntryInitialize(&skey[0], 0, - Anum_pg_description_objoid, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(oid), OIDOID); - ScanKeyEntryInitialize(&skey[1], 0, - Anum_pg_description_classoid, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(classoid), OIDOID); - ScanKeyEntryInitialize(&skey[2], 0, - Anum_pg_description_objsubid, - BTEqualStrategyNumber, F_INT4EQ, - Int32GetDatum(subid), INT4OID); + ScanKeyInit(&skey[0], + Anum_pg_description_objoid, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(oid)); + ScanKeyInit(&skey[1], + Anum_pg_description_classoid, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(classoid)); + ScanKeyInit(&skey[2], + Anum_pg_description_objsubid, + BTEqualStrategyNumber, F_INT4EQ, + Int32GetDatum(subid)); description = heap_openr(DescriptionRelationName, RowExclusiveLock); @@ -231,21 +231,21 @@ DeleteComments(Oid oid, Oid classoid, int32 subid) /* Use the index to search for all matching old tuples */ - ScanKeyEntryInitialize(&skey[0], 0, - Anum_pg_description_objoid, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(oid), OIDOID); - ScanKeyEntryInitialize(&skey[1], 0, - Anum_pg_description_classoid, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(classoid), OIDOID); + ScanKeyInit(&skey[0], + Anum_pg_description_objoid, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(oid)); + ScanKeyInit(&skey[1], + Anum_pg_description_classoid, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(classoid)); if (subid != 0) { - ScanKeyEntryInitialize(&skey[2], 0, - Anum_pg_description_objsubid, - BTEqualStrategyNumber, F_INT4EQ, - Int32GetDatum(subid), INT4OID); + ScanKeyInit(&skey[2], + Anum_pg_description_objsubid, + BTEqualStrategyNumber, F_INT4EQ, + Int32GetDatum(subid)); nkeys = 3; } else @@ -538,10 +538,10 @@ CommentRule(List *qualname, char *comment) rulename = strVal(lfirst(qualname)); /* Search pg_rewrite for such a rule */ - ScanKeyEntryInitialize(&scanKeyData, 0, - Anum_pg_rewrite_rulename, - BTEqualStrategyNumber, F_NAMEEQ, - PointerGetDatum(rulename), NAMEOID); + ScanKeyInit(&scanKeyData, + Anum_pg_rewrite_rulename, + BTEqualStrategyNumber, F_NAMEEQ, + PointerGetDatum(rulename)); RewriteRelation = heap_openr(RewriteRelationName, AccessShareLock); scanDesc = heap_beginscan(RewriteRelation, SnapshotNow, @@ -791,15 +791,14 @@ CommentTrigger(List *qualname, char *comment) * because of the unique index. */ pg_trigger = heap_openr(TriggerRelationName, AccessShareLock); - ScanKeyEntryInitialize(&entry[0], 0, - Anum_pg_trigger_tgrelid, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(RelationGetRelid(relation)), - OIDOID); - ScanKeyEntryInitialize(&entry[1], 0, - Anum_pg_trigger_tgname, - BTEqualStrategyNumber, F_NAMEEQ, - CStringGetDatum(trigname), NAMEOID); + ScanKeyInit(&entry[0], + Anum_pg_trigger_tgrelid, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(RelationGetRelid(relation))); + ScanKeyInit(&entry[1], + Anum_pg_trigger_tgname, + BTEqualStrategyNumber, F_NAMEEQ, + CStringGetDatum(trigname)); scan = systable_beginscan(pg_trigger, TriggerRelidNameIndex, true, SnapshotNow, 2, entry); triggertuple = systable_getnext(scan); @@ -872,11 +871,10 @@ CommentConstraint(List *qualname, char *comment) */ pg_constraint = heap_openr(ConstraintRelationName, AccessShareLock); - ScanKeyEntryInitialize(&skey[0], 0, - Anum_pg_constraint_conrelid, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(RelationGetRelid(relation)), - OIDOID); + ScanKeyInit(&skey[0], + Anum_pg_constraint_conrelid, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(RelationGetRelid(relation))); scan = systable_beginscan(pg_constraint, ConstraintRelidIndex, true, SnapshotNow, 1, skey); |