summaryrefslogtreecommitdiff
path: root/src/backend/access/index/indexam.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-04-17 20:57:57 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-04-17 20:57:57 +0000
commit27a54ae282d74ee471a5b34d136fe3d4f894a9de (patch)
tree59aedb6b78d8b4ff8f26f6a945799a443dd6d571 /src/backend/access/index/indexam.c
parentd85a81cbc384614eec525ca19e1cf48687643725 (diff)
Opclasses live in namespaces. I also took the opportunity to create
an 'opclass owner' column in pg_opclass. Nothing is done with it at present, but since there are plans to invent a CREATE OPERATOR CLASS command soon, we'll probably want DROP OPERATOR CLASS too, which suggests that a notion of ownership would be a good idea.
Diffstat (limited to 'src/backend/access/index/indexam.c')
-rw-r--r--src/backend/access/index/indexam.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/backend/access/index/indexam.c b/src/backend/access/index/indexam.c
index ea043afb341..ce2c8e62f45 100644
--- a/src/backend/access/index/indexam.c
+++ b/src/backend/access/index/indexam.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/index/indexam.c,v 1.56 2002/03/26 19:15:14 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/index/indexam.c,v 1.57 2002/04/17 20:57:56 tgl Exp $
*
* INTERFACE ROUTINES
* index_open - open an index relation by relation OID
@@ -498,10 +498,23 @@ index_getprocinfo(Relation irel,
if (locinfo->fn_oid == InvalidOid)
{
RegProcedure *loc = irel->rd_support;
+ RegProcedure procId;
Assert(loc != NULL);
- fmgr_info_cxt(loc[procindex], locinfo, irel->rd_indexcxt);
+ procId = loc[procindex];
+
+ /*
+ * Complain if function was not found during IndexSupportInitialize.
+ * This should not happen unless the system tables contain bogus
+ * entries for the index opclass. (If an AM wants to allow a
+ * support function to be optional, it can use index_getprocid.)
+ */
+ if (!RegProcedureIsValid(procId))
+ elog(ERROR, "Missing support function %d for attribute %d of index %s",
+ procnum, attnum, RelationGetRelationName(irel));
+
+ fmgr_info_cxt(procId, locinfo, irel->rd_indexcxt);
}
return locinfo;