Re: more ALTER .. DEPENDS ON EXTENSION fixes
Alvaro Herrera <alvherre@2ndquadrant.com>
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Ibrar Ahmed <ibrar.ahmad@gmail.com>, Ahsan Hadi <ahsan.hadi@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2020-04-09T23:30:19Z
Lists: pgsql-hackers
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
Commits
-
Add tab-completion for ALTER INDEX .. [NO] DEPENDS ON
- 1e324cb0e761 13.0 landed
-
Add ALTER .. NO DEPENDS ON
- 5fc703946bf3 13.0 landed
-
Add pg_dump support for ALTER obj DEPENDS ON EXTENSION
- f977e6dec8a0 12.3 landed
- e70187c9b47c 11.8 landed
- d04e342ba404 10.13 landed
- b08dee24a557 13.0 landed
- 2b9d70159154 9.6.18 landed
-
Avoid duplicates in ALTER ... DEPENDS ON EXTENSION
- b7739ebecdcc 12.3 landed
- 899a04f5ed61 13.0 landed
- 7c094a11c70d 11.8 landed
- 73b31e784d64 9.6.18 landed
- 3dfd2d6cd28a 10.13 landed