Re: WIP: Enhanced ALTER OPERATOR - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: WIP: Enhanced ALTER OPERATOR
Date
Msg-id 559FBEAB.1060005@iki.fi
Whole thread Raw
In response to Re: WIP: Enhanced ALTER OPERATOR  (Uriy Zhuravlev <u.zhuravlev@postgrespro.ru>)
Responses Re: WIP: Enhanced ALTER OPERATOR  (Uriy Zhuravlev <u.zhuravlev@postgrespro.ru>)
List pgsql-hackers
On 07/06/2015 07:21 PM, Uriy Zhuravlev wrote:
> Hello hackers.
>
> This is the fifth version of the patch (the fourth was unsuccessful :)).
> I added documentation and was held a small refactoring.

I edited the formatting of the syntax page a bit, and came up with this:

ALTER OPERATOR name ( { left_type | NONE } , { right_type | NONE } )
     SET ( {  RESTRICT = { res_proc | NULL }
            | JOIN = { join_proc | NULL }
          } [, ... ] )

A couple of minor issues with the syntax itself:

* I think it'd be better to use NONE instead of NULL above, to remove
the estimator. It seems inconsistent when we've used NONE to mean
"missing" earlier in the same statement.

* The way you check for the NULL in OperatorUpd is wrong. It cannot
distinguish between a quoted "null", meaning a function called "null",
and a NULL, meaning no function. (You can argue that you're just asking
for trouble if you name any function "null", but we're careful to deal
with that correctly everywhere else.) You don't have the information
about quoting once you leave the parser, so you'll have to distinguish
those in the grammar.

Attached is a new version of your patch, rebased over current master,
and the docs formatting fixes.

- Heikki


Attachment

pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: [PATCH] Generalized JSON output functions
Next
From: Heikki Linnakangas
Date:
Subject: Re: ctidscan as an example of custom-scan (Re: [v9.5] Custom Plan API)