diff options
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/commands/operatorcmds.c | 10 | ||||
-rw-r--r-- | src/backend/parser/gram.y | 11 | ||||
-rw-r--r-- | src/backend/parser/scan.l | 6 |
3 files changed, 16 insertions, 11 deletions
diff --git a/src/backend/commands/operatorcmds.c b/src/backend/commands/operatorcmds.c index 1efaacfd5e2..b4a1aac3a14 100644 --- a/src/backend/commands/operatorcmds.c +++ b/src/backend/commands/operatorcmds.c @@ -87,16 +87,6 @@ DefineOperator(List *names, List *parameters) /* Convert list of names to a name and namespace */ oprNamespace = QualifiedNameGetCreationNamespace(names, &oprName); - /* - * The SQL standard committee has decided that => should be used for named - * parameters; therefore, a future release of PostgreSQL may disallow it - * as the name of a user-defined operator. - */ - if (strcmp(oprName, "=>") == 0) - ereport(WARNING, - (errmsg("=> is deprecated as an operator name"), - errdetail("This name may be disallowed altogether in future versions of PostgreSQL."))); - /* Check we have creation rights in target namespace */ aclresult = pg_namespace_aclcheck(oprNamespace, GetUserId(), ACL_CREATE); if (aclresult != ACLCHECK_OK) diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 435c0451cae..21b8897038f 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -533,7 +533,7 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query); */ %token <str> IDENT FCONST SCONST BCONST XCONST Op %token <ival> ICONST PARAM -%token TYPECAST DOT_DOT COLON_EQUALS +%token TYPECAST DOT_DOT COLON_EQUALS EQUALS_GREATER /* * If you want to make any keyword changes, update the keyword table in @@ -12567,6 +12567,15 @@ func_arg_expr: a_expr na->location = @1; $$ = (Node *) na; } + | param_name EQUALS_GREATER a_expr + { + NamedArgExpr *na = makeNode(NamedArgExpr); + na->name = $1; + na->arg = (Expr *) $3; + na->argnumber = -1; /* until determined */ + na->location = @1; + $$ = (Node *) na; + } ; type_list: Typename { $$ = list_make1($1); } diff --git a/src/backend/parser/scan.l b/src/backend/parser/scan.l index a78ce03fbd5..a0e20434ef3 100644 --- a/src/backend/parser/scan.l +++ b/src/backend/parser/scan.l @@ -334,6 +334,7 @@ identifier {ident_start}{ident_cont}* typecast "::" dot_dot \.\. colon_equals ":=" +equals_greater "=>" /* * "self" is the set of chars that should be returned as single-character @@ -808,6 +809,11 @@ other . return COLON_EQUALS; } +{equals_greater} { + SET_YYLLOC(); + return EQUALS_GREATER; + } + {self} { SET_YYLLOC(); return yytext[0]; |