diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-11-09 21:30:38 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-11-09 21:30:38 +0000 |
commit | c1d62bfd00f4d1ea0647e12947ca1de9fea39b33 (patch) | |
tree | 1afdccb5267627182cab94b347730657107ad6eb /src/backend/commands/opclasscmds.c | |
parent | 723825afebb6de7212fa18882bcc78212d5c1743 (diff) |
Add operator strategy and comparison-value datatype fields to ScanKey.
Remove the 'strategy map' code, which was a large amount of mechanism
that no longer had any use except reverse-mapping from procedure OID to
strategy number. Passing the strategy number to the index AM in the
first place is simpler and faster.
This is a preliminary step in planned support for cross-datatype index
operations. I'm committing it now since the ScanKeyEntryInitialize()
API change touches quite a lot of files, and I want to commit those
changes before the tree drifts under me.
Diffstat (limited to 'src/backend/commands/opclasscmds.c')
-rw-r--r-- | src/backend/commands/opclasscmds.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/backend/commands/opclasscmds.c b/src/backend/commands/opclasscmds.c index c183d7ad5bc..599d2eb8259 100644 --- a/src/backend/commands/opclasscmds.c +++ b/src/backend/commands/opclasscmds.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/opclasscmds.c,v 1.21 2003/09/26 15:27:31 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/opclasscmds.c,v 1.22 2003/11/09 21:30:36 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -25,6 +25,7 @@ #include "catalog/pg_amop.h" #include "catalog/pg_amproc.h" #include "catalog/pg_opclass.h" +#include "catalog/pg_type.h" #include "commands/defrem.h" #include "miscadmin.h" #include "parser/parse_func.h" @@ -270,9 +271,10 @@ DefineOpClass(CreateOpClassStmt *stmt) ScanKeyData skey[1]; SysScanDesc scan; - ScanKeyEntryInitialize(&skey[0], 0x0, - Anum_pg_opclass_opcamid, F_OIDEQ, - ObjectIdGetDatum(amoid)); + ScanKeyEntryInitialize(&skey[0], 0, + Anum_pg_opclass_opcamid, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(amoid), OIDOID); scan = systable_beginscan(rel, OpclassAmNameNspIndex, true, SnapshotNow, 1, skey); @@ -589,8 +591,9 @@ RemoveOpClassById(Oid opclassOid) * Remove associated entries in pg_amop. */ ScanKeyEntryInitialize(&skey[0], 0, - Anum_pg_amop_amopclaid, F_OIDEQ, - ObjectIdGetDatum(opclassOid)); + Anum_pg_amop_amopclaid, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(opclassOid), OIDOID); rel = heap_openr(AccessMethodOperatorRelationName, RowExclusiveLock); @@ -607,8 +610,9 @@ RemoveOpClassById(Oid opclassOid) * Remove associated entries in pg_amproc. */ ScanKeyEntryInitialize(&skey[0], 0, - Anum_pg_amproc_amopclaid, F_OIDEQ, - ObjectIdGetDatum(opclassOid)); + Anum_pg_amproc_amopclaid, + BTEqualStrategyNumber, F_OIDEQ, + ObjectIdGetDatum(opclassOid), OIDOID); rel = heap_openr(AccessMethodProcedureRelationName, RowExclusiveLock); |