aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/selfuncs.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-04-16 23:08:12 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-04-16 23:08:12 +0000
commit6cef5d2549110c6c0abb92215c2593e652024493 (patch)
tree7481a5b0bec7227c23f4b846cd7a1e40b47bf20e /src/backend/utils/adt/selfuncs.c
parent4da51bfd6d89762f0a3cacde6edf1ac63c09349e (diff)
downloadpostgresql-6cef5d2549110c6c0abb92215c2593e652024493.tar.gz
postgresql-6cef5d2549110c6c0abb92215c2593e652024493.zip
Operators live in namespaces. CREATE/DROP/COMMENT ON OPERATOR take
qualified operator names directly, for example CREATE OPERATOR myschema.+ ( ... ). To qualify an operator name in an expression you need to write OPERATOR(myschema.+) (thanks to Peter for suggesting an escape hatch). I also took advantage of having to reformat pg_operator to fix something that'd been bugging me for a while: mergejoinable operators should have explicit links to the associated cross-data-type comparison operators, rather than hardwiring an assumption that they are named < and >.
Diffstat (limited to 'src/backend/utils/adt/selfuncs.c')
-rw-r--r--src/backend/utils/adt/selfuncs.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c
index e8e71dec25a..3b1af8df5e1 100644
--- a/src/backend/utils/adt/selfuncs.c
+++ b/src/backend/utils/adt/selfuncs.c
@@ -15,7 +15,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.107 2002/04/03 05:39:31 petere Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.108 2002/04/16 23:08:11 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -74,6 +74,7 @@
#include "access/heapam.h"
#include "catalog/catname.h"
+#include "catalog/pg_namespace.h"
#include "catalog/pg_operator.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_statistic.h"
@@ -3285,14 +3286,15 @@ string_lessthan(const char *str1, const char *str2, Oid datatype)
}
/* See if there is a binary op of the given name for the given datatype */
+/* NB: we assume that only built-in system operators are searched for */
static Oid
find_operator(const char *opname, Oid datatype)
{
- return GetSysCacheOid(OPERNAME,
+ return GetSysCacheOid(OPERNAMENSP,
PointerGetDatum(opname),
ObjectIdGetDatum(datatype),
ObjectIdGetDatum(datatype),
- CharGetDatum('b'));
+ ObjectIdGetDatum(PG_CATALOG_NAMESPACE));
}
/*