mirror of
https://github.com/postgres/postgres.git
synced 2025-07-12 21:01:52 +03:00
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 >.
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/makefuncs.c,v 1.30 2002/03/29 19:06:09 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/makefuncs.c,v 1.31 2002/04/16 23:08:10 tgl Exp $
|
||||
*/
|
||||
#include "postgres.h"
|
||||
|
||||
@ -16,6 +16,39 @@
|
||||
#include "utils/lsyscache.h"
|
||||
|
||||
|
||||
/*
|
||||
* makeA_Expr -
|
||||
* makes an A_Expr node
|
||||
*/
|
||||
A_Expr *
|
||||
makeA_Expr(int oper, List *name, Node *lexpr, Node *rexpr)
|
||||
{
|
||||
A_Expr *a = makeNode(A_Expr);
|
||||
|
||||
a->oper = oper;
|
||||
a->name = name;
|
||||
a->lexpr = lexpr;
|
||||
a->rexpr = rexpr;
|
||||
return a;
|
||||
}
|
||||
|
||||
/*
|
||||
* makeSimpleA_Expr -
|
||||
* As above, given a simple (unqualified) operator name
|
||||
*/
|
||||
A_Expr *
|
||||
makeSimpleA_Expr(int oper, const char *name,
|
||||
Node *lexpr, Node *rexpr)
|
||||
{
|
||||
A_Expr *a = makeNode(A_Expr);
|
||||
|
||||
a->oper = oper;
|
||||
a->name = makeList1(makeString((char *) name));
|
||||
a->lexpr = lexpr;
|
||||
a->rexpr = rexpr;
|
||||
return a;
|
||||
}
|
||||
|
||||
/*
|
||||
* makeOper -
|
||||
* creates an Oper node
|
||||
|
Reference in New Issue
Block a user