Re: more ALTER .. DEPENDS ON EXTENSION fixes
Ibrar Ahmed <ibrar.ahmad@gmail.com>
From: Ibrar Ahmed <ibrar.ahmad@gmail.com>
To: Ahsan Hadi <ahsan.hadi@gmail.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2020-03-05T18:20:43Z
Lists: pgsql-hackers
On Mon, Mar 2, 2020 at 12:45 PM Ahsan Hadi <ahsan.hadi@gmail.com> wrote: > > > On Sat, Feb 29, 2020 at 2:38 AM Alvaro Herrera <alvherre@2ndquadrant.com> > wrote: > >> On 2020-Feb-28, ahsan hadi wrote: >> >> >> > Tested the pg_dump patch for dumping "ALTER .. DEPENDS ON EXTENSION" in >> case of indexes, functions, triggers etc. The "ALTER .. DEPENDS ON >> EXTENSION" is included in the dump. However in some case not sure why >> "ALTER INDEX.....DEPENDS ON EXTENSION" is repeated several times in the >> dump? >> >> Hi, thanks for testing. >> >> Are the repeated commands for the same index, same extension? > > > Yes same index and same extension... > You cannot do that after applying all the patches. > > >> Did you >> apply the same command multiple times before running pg_dump? >> > > Yes but in some cases I applied the command once and it appeared multiple > times in the dump.. > Not for me, it works for me. > > >> >> There was an off-list complaint that if you repeat the ALTER .. DEPENDS >> for the same object on the same extension, then the same dependency is >> registered multiple times. (You can search pg_depend for "deptype = 'x'" >> to see that). I suppose that would lead to the line being output >> multiple times by pg_dump, also. Is that what you did? >> > > I checked out pg_depend for "deptype='x'" the same dependency is > registered multiple times... > >> >> If so: Patch 0002 is supposed to fix that problem, by raising an error >> if the dependency is already registered ... though it occurs to me now >> that it would be more in line with custom to make the command a silent >> no-op. In fact, doing that would cause old dumps (generated with >> databases containing duplicated entries) to correctly restore a single >> entry, without error. Therefore my inclination now is to change 0002 >> that way and push and backpatch it ahead of 0001. >> > > Makes sense, will also try our Patch 0002. > >> >> I realize just now that I have failed to verify what happens with >> partitioned indexes. >> > > Yes I also missed this one.. > It works for partitioned indexes. Is this intentional that there is no error when removing a non-existing dependency?
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