pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Ibrar Ahmed <ibrar.ahmad@gmail.com>
Cc: Ahsan Hadi <ahsan.hadi@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: more ALTER .. DEPENDS ON EXTENSION fixes
Date: Thu, 9 Apr 2020 19:30:19 -0400
Message-ID: <20200409233019.GA26510@alvherre.pgsql> (raw)
In-Reply-To: <3926.1583937053@sss.pgh.pa.us>

On 2020-Mar-11, Tom Lane wrote:

> BTW, I did not like the syntax too much.  "NO DEPENDS ON EXTENSION"
> doesn't seem like good English.  "NOT DEPENDS ON EXTENSION" is hardly
> any better.  The real problem with both is that an ALTER action should
> be, well, an action.  A grammar stickler would say that it should be
> "ALTER thing DROP DEPENDENCY ON EXTENSION ext", but perhaps we could
> get away with "ALTER thing DROP DEPENDS ON EXTENSION ext" to avoid
> adding a new keyword.  By that logic the original command should have
> been "ALTER thing ADD DEPENDS ON EXTENSION ext", but I suppose it's
> too late for that.

The problem with DROP DEPENDS is alter_table_cmd, which already defines
"DROP opt_column ColId", so there's a reduce/reduce conflict for the
ALTER INDEX and ALTER MATERIALIZED VIEW forms because "depends" could be
a column name.  (It works fine for ALTER FUNCTION/ROUTINE/PROCEDURE/TRIGGER
because there's no command that tries to define a conflicting DROP form
for these.)

It works if I change DEPENDS to be type_func_name_keyword (currently
unreserved_keyword), but I bet we won't like that.

(DEPENDENCY is not a keyword of any kind, so DROP DEPENDENCY require us
making it one of high reservedness, which I suspect we don't like
either).

It would also work to use a different keyword in the DROP position;
maybe REMOVE.  But that's not a keyword currently.

How about ALTER ..  REVOKE DEPENDS or DELETE DEPENDS?  Bison is okay
with either of those forms.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





view thread (17+ messages)  latest in thread

Message-ID: <20200409233019.GA26510@alvherre.pgsql>
Permalink:  ../20200409233019.GA26510@alvherre.pgsql/
Also on:    postgresql.org/message-id/20200409233019.GA26510@alvherre.pgsql

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@2ndquadrant.com, tgl@sss.pgh.pa.us, ibrar.ahmad@gmail.com, ahsan.hadi@gmail.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: more ALTER .. DEPENDS ON EXTENSION fixes
  In-Reply-To: <20200409233019.GA26510@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox