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/catalog | |
| parent | 49f98fa833407b4e4252e42522e640ec8a0d08b2 (diff) | |
| download | postgresql-fa5c8a055a02e44f446e4593e397c33a572c4d67.tar.gz | |
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/catalog')
| -rw-r--r-- | src/backend/catalog/aclchk.c | 26 | ||||
| -rw-r--r-- | src/backend/catalog/dependency.c | 120 | ||||
| -rw-r--r-- | src/backend/catalog/heap.c | 75 | ||||
| -rw-r--r-- | src/backend/catalog/index.c | 18 | ||||
| -rw-r--r-- | src/backend/catalog/pg_constraint.c | 42 | ||||
| -rw-r--r-- | src/backend/catalog/pg_conversion.c | 11 | ||||
| -rw-r--r-- | src/backend/catalog/pg_depend.c | 35 | ||||
| -rw-r--r-- | src/backend/catalog/pg_largeobject.c | 19 |
8 files changed, 168 insertions, 178 deletions
diff --git a/src/backend/catalog/aclchk.c b/src/backend/catalog/aclchk.c index a1b697bee8..7534750c99 100644 --- a/src/backend/catalog/aclchk.c +++ b/src/backend/catalog/aclchk.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.92 2003/11/09 21:30:35 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.93 2003/11/12 21:15:48 tgl Exp $ * * NOTES * See acl.h. @@ -366,10 +366,10 @@ ExecuteGrantStmt_Database(GrantStmt *stmt) char replaces[Natts_pg_database]; relation = heap_openr(DatabaseRelationName, RowExclusiveLock); - ScanKeyEntryInitialize(&entry[0], 0, - Anum_pg_database_datname, - BTEqualStrategyNumber, F_NAMEEQ, - CStringGetDatum(dbname), NAMEOID); + ScanKeyInit(&entry[0], + Anum_pg_database_datname, + BTEqualStrategyNumber, F_NAMEEQ, + CStringGetDatum(dbname)); scan = heap_beginscan(relation, SnapshotNow, 1, entry); tuple = heap_getnext(scan, ForwardScanDirection); if (!HeapTupleIsValid(tuple)) @@ -1131,10 +1131,10 @@ pg_database_aclcheck(Oid db_oid, AclId userid, AclMode mode) * There's no syscache for pg_database, so must look the hard way */ pg_database = heap_openr(DatabaseRelationName, AccessShareLock); - ScanKeyEntryInitialize(&entry[0], 0, - ObjectIdAttributeNumber, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(db_oid), OIDOID); + ScanKeyInit(&entry[0], + ObjectIdAttributeNumber, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(db_oid)); scan = heap_beginscan(pg_database, SnapshotNow, 1, entry); tuple = heap_getnext(scan, ForwardScanDirection); if (!HeapTupleIsValid(tuple)) @@ -1531,10 +1531,10 @@ pg_database_ownercheck(Oid db_oid, AclId userid) /* There's no syscache for pg_database, so must look the hard way */ pg_database = heap_openr(DatabaseRelationName, AccessShareLock); - ScanKeyEntryInitialize(&entry[0], 0, - ObjectIdAttributeNumber, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(db_oid), OIDOID); + ScanKeyInit(&entry[0], + ObjectIdAttributeNumber, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(db_oid)); scan = heap_beginscan(pg_database, SnapshotNow, 1, entry); dbtuple = heap_getnext(scan, ForwardScanDirection); diff --git a/src/backend/catalog/dependency.c b/src/backend/catalog/dependency.c index b0e17652c7..d64f027ef6 100644 --- a/src/backend/catalog/dependency.c +++ b/src/backend/catalog/dependency.c @@ -8,7 +8,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/catalog/dependency.c,v 1.32 2003/11/09 21:30:35 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/catalog/dependency.c,v 1.33 2003/11/12 21:15:48 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -31,7 +31,6 @@ #include "catalog/pg_opclass.h" #include "catalog/pg_rewrite.h" #include "catalog/pg_trigger.h" -#include "catalog/pg_type.h" #include "commands/comment.h" #include "commands/defrem.h" #include "commands/proclang.h" @@ -283,20 +282,20 @@ findAutoDeletableObjects(const ObjectAddress *object, * When dropping a whole object (subId = 0), find pg_depend records for * its sub-objects too. */ - ScanKeyEntryInitialize(&key[0], 0, - Anum_pg_depend_refclassid, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(object->classId), OIDOID); - ScanKeyEntryInitialize(&key[1], 0, - Anum_pg_depend_refobjid, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(object->objectId), OIDOID); + ScanKeyInit(&key[0], + Anum_pg_depend_refclassid, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(object->classId)); + ScanKeyInit(&key[1], + Anum_pg_depend_refobjid, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(object->objectId)); if (object->objectSubId != 0) { - ScanKeyEntryInitialize(&key[2], 0, - Anum_pg_depend_refobjsubid, - BTEqualStrategyNumber, F_INT4EQ, - Int32GetDatum(object->objectSubId), INT4OID); + ScanKeyInit(&key[2], + Anum_pg_depend_refobjsubid, + BTEqualStrategyNumber, F_INT4EQ, + Int32GetDatum(object->objectSubId)); nkeys = 3; } else @@ -418,20 +417,20 @@ recursiveDeletion(const ObjectAddress *object, * When dropping a whole object (subId = 0), remove all pg_depend records * for its sub-objects too. */ - ScanKeyEntryInitialize(&key[0], 0, - Anum_pg_depend_classid, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(object->classId), OIDOID); - ScanKeyEntryInitialize(&key[1], 0, - Anum_pg_depend_objid, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(object->objectId), OIDOID); + ScanKeyInit(&key[0], + Anum_pg_depend_classid, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(object->classId)); + ScanKeyInit(&key[1], + Anum_pg_depend_objid, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(object->objectId)); if (object->objectSubId != 0) { - ScanKeyEntryInitialize(&key[2], 0, - Anum_pg_depend_objsubid, - BTEqualStrategyNumber, F_INT4EQ, - Int32GetDatum(object->objectSubId), INT4OID); + ScanKeyInit(&key[2], + Anum_pg_depend_objsubid, + BTEqualStrategyNumber, F_INT4EQ, + Int32GetDatum(object->objectSubId)); nkeys = 3; } else @@ -651,20 +650,20 @@ deleteDependentObjects(const ObjectAddress *object, HeapTuple tup; ObjectAddress otherObject; - ScanKeyEntryInitialize(&key[0], 0, - Anum_pg_depend_refclassid, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(object->classId), OIDOID); - ScanKeyEntryInitialize(&key[1], 0, - Anum_pg_depend_refobjid, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(object->objectId), OIDOID); + ScanKeyInit(&key[0], + Anum_pg_depend_refclassid, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(object->classId)); + ScanKeyInit(&key[1], + Anum_pg_depend_refobjid, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(object->objectId)); if (object->objectSubId != 0) { - ScanKeyEntryInitialize(&key[2], 0, - Anum_pg_depend_refobjsubid, - BTEqualStrategyNumber, F_INT4EQ, - Int32GetDatum(object->objectSubId), INT4OID); + ScanKeyInit(&key[2], + Anum_pg_depend_refobjsubid, + BTEqualStrategyNumber, F_INT4EQ, + Int32GetDatum(object->objectSubId)); nkeys = 3; } else @@ -1473,11 +1472,10 @@ getObjectDescription(const ObjectAddress *object) castDesc = heap_openr(CastRelationName, AccessShareLock); - ScanKeyEntryInitialize(&skey[0], 0, - ObjectIdAttributeNumber, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(object->objectId), - OIDOID); + ScanKeyInit(&skey[0], + ObjectIdAttributeNumber, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(object->objectId)); rcscan = systable_beginscan(castDesc, CastOidIndex, true, SnapshotNow, 1, skey); @@ -1509,11 +1507,10 @@ getObjectDescription(const ObjectAddress *object) conDesc = heap_openr(ConstraintRelationName, AccessShareLock); - ScanKeyEntryInitialize(&skey[0], 0, - ObjectIdAttributeNumber, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(object->objectId), - OIDOID); + ScanKeyInit(&skey[0], + ObjectIdAttributeNumber, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(object->objectId)); rcscan = systable_beginscan(conDesc, ConstraintOidIndex, true, SnapshotNow, 1, skey); @@ -1570,11 +1567,10 @@ getObjectDescription(const ObjectAddress *object) attrdefDesc = heap_openr(AttrDefaultRelationName, AccessShareLock); - ScanKeyEntryInitialize(&skey[0], 0, - ObjectIdAttributeNumber, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(object->objectId), - OIDOID); + ScanKeyInit(&skey[0], + ObjectIdAttributeNumber, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(object->objectId)); adscan = systable_beginscan(attrdefDesc, AttrDefaultOidIndex, true, SnapshotNow, 1, skey); @@ -1672,11 +1668,10 @@ getObjectDescription(const ObjectAddress *object) ruleDesc = heap_openr(RewriteRelationName, AccessShareLock); - ScanKeyEntryInitialize(&skey[0], 0, - ObjectIdAttributeNumber, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(object->objectId), - OIDOID); + ScanKeyInit(&skey[0], + ObjectIdAttributeNumber, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(object->objectId)); rcscan = systable_beginscan(ruleDesc, RewriteOidIndex, true, SnapshotNow, 1, skey); @@ -1708,11 +1703,10 @@ getObjectDescription(const ObjectAddress *object) trigDesc = heap_openr(TriggerRelationName, AccessShareLock); - ScanKeyEntryInitialize(&skey[0], 0, - ObjectIdAttributeNumber, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(object->objectId), - OIDOID); + ScanKeyInit(&skey[0], + ObjectIdAttributeNumber, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(object->objectId)); tgscan = systable_beginscan(trigDesc, TriggerOidIndex, true, SnapshotNow, 1, skey); diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c index 75445334ec..a0962f487d 100644 --- a/src/backend/catalog/heap.c +++ b/src/backend/catalog/heap.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.254 2003/11/09 21:30:36 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.255 2003/11/12 21:15:48 tgl Exp $ * * * INTERFACE ROUTINES @@ -853,11 +853,10 @@ RelationRemoveInheritance(Relation relation) catalogRelation = heap_openr(InheritsRelationName, RowExclusiveLock); - ScanKeyEntryInitialize(&key, 0, - Anum_pg_inherits_inhrelid, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(RelationGetRelid(relation)), - OIDOID); + ScanKeyInit(&key, + Anum_pg_inherits_inhrelid, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(RelationGetRelid(relation))); scan = systable_beginscan(catalogRelation, InheritsRelidSeqnoIndex, true, SnapshotNow, 1, &key); @@ -920,10 +919,10 @@ DeleteAttributeTuples(Oid relid) attrel = heap_openr(AttributeRelationName, RowExclusiveLock); /* Use the index to scan only attributes of the target relation */ - ScanKeyEntryInitialize(&key[0], 0, - Anum_pg_attribute_attrelid, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(relid), OIDOID); + ScanKeyInit(&key[0], + Anum_pg_attribute_attrelid, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(relid)); scan = systable_beginscan(attrel, AttributeRelidNumIndex, true, SnapshotNow, 1, key); @@ -1035,14 +1034,14 @@ RemoveAttrDefault(Oid relid, AttrNumber attnum, attrdef_rel = heap_openr(AttrDefaultRelationName, RowExclusiveLock); - ScanKeyEntryInitialize(&scankeys[0], 0, - Anum_pg_attrdef_adrelid, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(relid), OIDOID); - ScanKeyEntryInitialize(&scankeys[1], 0, - Anum_pg_attrdef_adnum, - BTEqualStrategyNumber, F_INT2EQ, - Int16GetDatum(attnum), INT2OID); + ScanKeyInit(&scankeys[0], + Anum_pg_attrdef_adrelid, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(relid)); + ScanKeyInit(&scankeys[1], + Anum_pg_attrdef_adnum, + BTEqualStrategyNumber, F_INT2EQ, + Int16GetDatum(attnum)); scan = systable_beginscan(attrdef_rel, AttrDefaultIndex, true, SnapshotNow, 2, scankeys); @@ -1092,10 +1091,10 @@ RemoveAttrDefaultById(Oid attrdefId) attrdef_rel = heap_openr(AttrDefaultRelationName, RowExclusiveLock); /* Find the pg_attrdef tuple */ - ScanKeyEntryInitialize(&scankeys[0], 0, - ObjectIdAttributeNumber, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(attrdefId), OIDOID); + ScanKeyInit(&scankeys[0], + ObjectIdAttributeNumber, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(attrdefId)); scan = systable_beginscan(attrdef_rel, AttrDefaultOidIndex, true, SnapshotNow, 1, scankeys); @@ -1829,10 +1828,10 @@ RemoveRelConstraints(Relation rel, const char *constrName, conrel = heap_openr(ConstraintRelationName, RowExclusiveLock); /* Use the index to scan only constraints of the target relation */ - ScanKeyEntryInitialize(&key[0], 0, - Anum_pg_constraint_conrelid, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(RelationGetRelid(rel)), OIDOID); + ScanKeyInit(&key[0], + Anum_pg_constraint_conrelid, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(RelationGetRelid(rel))); conscan = systable_beginscan(conrel, ConstraintRelidIndex, true, SnapshotNow, 1, key); @@ -1883,19 +1882,19 @@ RemoveStatistics(Relation rel, AttrNumber attnum) pgstatistic = heap_openr(StatisticRelationName, RowExclusiveLock); - ScanKeyEntryInitialize(&key[0], 0, - Anum_pg_statistic_starelid, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(RelationGetRelid(rel)), OIDOID); + ScanKeyInit(&key[0], + Anum_pg_statistic_starelid, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(RelationGetRelid(rel))); if (attnum == 0) nkeys = 1; else { - ScanKeyEntryInitialize(&key[1], 0, - Anum_pg_statistic_staattnum, - BTEqualStrategyNumber, F_INT2EQ, - Int16GetDatum(attnum), INT2OID); + ScanKeyInit(&key[1], + Anum_pg_statistic_staattnum, + BTEqualStrategyNumber, F_INT2EQ, + Int16GetDatum(attnum)); nkeys = 2; } @@ -2050,10 +2049,10 @@ heap_truncate_check_FKs(Relation rel) */ fkeyRel = heap_openr(ConstraintRelationName, AccessShareLock); - ScanKeyEntryInitialize(&key, 0, - Anum_pg_constraint_confrelid, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(relid), OIDOID); + ScanKeyInit(&key, + Anum_pg_constraint_confrelid, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(relid)); fkeyScan = systable_beginscan(fkeyRel, NULL, false, SnapshotNow, 1, &key); diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c index 67f970c55d..72f76b01b0 100644 --- a/src/backend/catalog/index.c +++ b/src/backend/catalog/index.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.220 2003/11/09 21:30:36 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.221 2003/11/12 21:15:48 tgl Exp $ * * * INTERFACE ROUTINES @@ -992,10 +992,10 @@ setRelhasindex(Oid relid, bool hasindex, bool isprimary, Oid reltoastidxid) { ScanKeyData key[1]; - ScanKeyEntryInitialize(&key[0], 0, - ObjectIdAttributeNumber, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(relid), OIDOID); + ScanKeyInit(&key[0], + ObjectIdAttributeNumber, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(relid)); pg_class_scan = heap_beginscan(pg_class, SnapshotNow, 1, key); tuple = heap_getnext(pg_class_scan, ForwardScanDirection); @@ -1195,10 +1195,10 @@ UpdateStats(Oid relid, double reltuples) { ScanKeyData key[1]; - ScanKeyEntryInitialize(&key[0], 0, - ObjectIdAttributeNumber, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(relid), OIDOID); + ScanKeyInit(&key[0], + ObjectIdAttributeNumber, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(relid)); pg_class_scan = heap_beginscan(pg_class, SnapshotNow, 1, key); tuple = heap_getnext(pg_class_scan, ForwardScanDirection); diff --git a/src/backend/catalog/pg_constraint.c b/src/backend/catalog/pg_constraint.c index 0fa665a568..2cb71f6bfc 100644 --- a/src/backend/catalog/pg_constraint.c +++ b/src/backend/catalog/pg_constraint.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/catalog/pg_constraint.c,v 1.17 2003/11/09 21:30:36 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/catalog/pg_constraint.c,v 1.18 2003/11/12 21:15:48 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -281,15 +281,15 @@ ConstraintNameIsUsed(CONSTRAINTCATEGORY conCat, Oid objId, Oid objNamespace, con found = false; - ScanKeyEntryInitialize(&skey[0], 0, - Anum_pg_constraint_conname, - BTEqualStrategyNumber, F_NAMEEQ, - CStringGetDatum(cname), NAMEOID); + ScanKeyInit(&skey[0], + Anum_pg_constraint_conname, + BTEqualStrategyNumber, F_NAMEEQ, + CStringGetDatum(cname)); - ScanKeyEntryInitialize(&skey[1], 0, - Anum_pg_constraint_connamespace, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(objNamespace), OIDOID); + ScanKeyInit(&skey[1], + Anum_pg_constraint_connamespace, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(objNamespace)); conscan = systable_beginscan(conDesc, ConstraintNameNspIndex, true, SnapshotNow, 2, skey); @@ -355,15 +355,15 @@ GenerateConstraintName(CONSTRAINTCATEGORY conCat, Oid objId, Oid objNamespace, i */ found = false; - ScanKeyEntryInitialize(&skey[0], 0, - Anum_pg_constraint_conname, - BTEqualStrategyNumber, F_NAMEEQ, - CStringGetDatum(cname), NAMEOID); + ScanKeyInit(&skey[0], + Anum_pg_constraint_conname, + BTEqualStrategyNumber, F_NAMEEQ, + CStringGetDatum(cname)); - ScanKeyEntryInitialize(&skey[1], 0, - Anum_pg_constraint_connamespace, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(objNamespace), OIDOID); + ScanKeyInit(&skey[1], + Anum_pg_constraint_connamespace, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(objNamespace)); conscan = systable_beginscan(conDesc, ConstraintNameNspIndex, true, SnapshotNow, 2, skey); @@ -422,10 +422,10 @@ RemoveConstraintById(Oid conId) conDesc = heap_openr(ConstraintRelationName, RowExclusiveLock); - ScanKeyEntryInitialize(&skey[0], 0, - ObjectIdAttributeNumber, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(conId), OIDOID); + ScanKeyInit(&skey[0], + ObjectIdAttributeNumber, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(conId)); conscan = systable_beginscan(conDesc, ConstraintOidIndex, true, SnapshotNow, 1, skey); diff --git a/src/backend/catalog/pg_conversion.c b/src/backend/catalog/pg_conversion.c index 709f50f2a5..7f7811c88d 100644 --- a/src/backend/catalog/pg_conversion.c +++ b/src/backend/catalog/pg_conversion.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/catalog/pg_conversion.c,v 1.16 2003/11/09 21:30:36 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/catalog/pg_conversion.c,v 1.17 2003/11/12 21:15:48 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -21,7 +21,6 @@ #include "catalog/pg_class.h" #include "catalog/pg_conversion.h" #include "catalog/namespace.h" -#include "catalog/pg_type.h" #include "utils/builtins.h" #include "utils/lsyscache.h" #include "utils/syscache.h" @@ -177,10 +176,10 @@ RemoveConversionById(Oid conversionOid) HeapScanDesc scan; ScanKeyData scanKeyData; - ScanKeyEntryInitialize(&scanKeyData, 0, - ObjectIdAttributeNumber, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(conversionOid), OIDOID); + ScanKeyInit(&scanKeyData, + ObjectIdAttributeNumber, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(conversionOid)); /* open pg_conversion */ rel = heap_openr(ConversionRelationName, RowExclusiveLock); diff --git a/src/backend/catalog/pg_depend.c b/src/backend/catalog/pg_depend.c index 21eeb3e654..2bdb5b12d8 100644 --- a/src/backend/catalog/pg_depend.c +++ b/src/backend/catalog/pg_depend.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/catalog/pg_depend.c,v 1.8 2003/11/09 21:30:36 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/catalog/pg_depend.c,v 1.9 2003/11/12 21:15:48 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -20,7 +20,6 @@ #include "catalog/indexing.h" #include "catalog/dependency.h" #include "catalog/pg_depend.h" -#include "catalog/pg_type.h" #include "miscadmin.h" #include "utils/fmgroids.h" @@ -139,14 +138,14 @@ deleteDependencyRecordsFor(Oid classId, Oid objectId) depRel = heap_openr(DependRelationName, RowExclusiveLock); - ScanKeyEntryInitialize(&key[0], 0, - Anum_pg_depend_classid, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(classId), OIDOID); - ScanKeyEntryInitialize(&key[1], 0, - Anum_pg_depend_objid, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(objectId), OIDOID); + ScanKeyInit(&key[0], + Anum_pg_depend_classid, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(classId)); + ScanKeyInit(&key[1], + Anum_pg_depend_objid, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(objectId)); scan = systable_beginscan(depRel, DependDependerIndex, true, SnapshotNow, 2, key); @@ -181,15 +180,15 @@ isObjectPinned(const ObjectAddress *object, Relation rel) HeapTuple tup; ScanKeyData key[2]; - ScanKeyEntryInitialize(&key[0], 0, - Anum_pg_depend_refclassid, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(object->classId), OIDOID); + ScanKeyInit(&key[0], + Anum_pg_depend_refclassid, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(object->classId)); - ScanKeyEntryInitialize(&key[1], 0, - Anum_pg_depend_refobjid, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(object->objectId), OIDOID); + ScanKeyInit(&key[1], + Anum_pg_depend_refobjid, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(object->objectId)); scan = systable_beginscan(rel, DependReferenceIndex, true, SnapshotNow, 2, key); diff --git a/src/backend/catalog/pg_largeobject.c b/src/backend/catalog/pg_largeobject.c index 96f73056cf..022ca67d10 100644 --- a/src/backend/catalog/pg_largeobject.c +++ b/src/backend/catalog/pg_largeobject.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/catalog/pg_largeobject.c,v 1.18 2003/11/09 21:30:36 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/catalog/pg_largeobject.c,v 1.19 2003/11/12 21:15:48 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -19,7 +19,6 @@ #include "catalog/catname.h" #include "catalog/indexing.h" #include "catalog/pg_largeobject.h" -#include "catalog/pg_type.h" #include "miscadmin.h" #include "utils/builtins.h" #include "utils/fmgroids.h" @@ -82,10 +81,10 @@ LargeObjectDrop(Oid loid) SysScanDesc sd; HeapTuple tuple; - ScanKeyEntryInitialize(&skey[0], 0, - Anum_pg_largeobject_loid, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(loid), OIDOID); + ScanKeyInit(&skey[0], + Anum_pg_largeobject_loid, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(loid)); pg_largeobject = heap_openr(LargeObjectRelationName, RowExclusiveLock); @@ -120,10 +119,10 @@ LargeObjectExists(Oid loid) /* * See if we can find any tuples belonging to the specified LO */ - ScanKeyEntryInitialize(&skey[0], 0, - Anum_pg_largeobject_loid, - BTEqualStrategyNumber, F_OIDEQ, - ObjectIdGetDatum(loid), OIDOID); + ScanKeyInit(&skey[0], + Anum_pg_largeobject_loid, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(loid)); pg_largeobject = heap_openr(LargeObjectRelationName, AccessShareLock); |
