Re: [HACKERS] Multiple TO version in ALTER EXTENSION UPDATE - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Multiple TO version in ALTER EXTENSION UPDATE
Date
Msg-id 26235.1498143736@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] Multiple TO version in ALTER EXTENSION UPDATE  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: [HACKERS] Multiple TO version in ALTER EXTENSION UPDATE  (Daniel Gustafsson <daniel@yesql.se>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Wed, Mar 29, 2017 at 11:13 AM, Daniel Gustafsson <daniel@yesql.se> wrote:
>> While reading I noticed that we allow multiple TO <version> in ALTER EXTENSION
>> UPDATE, and defer throwing a syntax error until command processing.  Is there a
>> reason for deferring and not handling it in gram.y directly as in the attached
>> patch since it is in fact a syntax error?  It yields a different error message
>> to the user, but makes for easier to read code (IMH-and-biased-O).

> I think the idea of the current implementation was probably that the
> grammar should leave room to support multiple options in arbitrary
> order at that point in the syntax.  I'm not sure whether that's
> something we'll ever actually need, or not.

It certainly seems plausible to me that we might someday grow additional
options to control the UPDATE, so I'm inclined to reject this patch.
If it were saving a meaningful amount of grammar code, I might think
differently, but it's not really.  And it's not like we don't use the
same grammar pattern in lots of other places.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [HACKERS] Redundant check of em_is_child
Next
From: Robert Haas
Date:
Subject: Re: [HACKERS] [psql] patch to fix ordering in words_after_create array