Avoid duplicates in ALTER ... DEPENDS ON EXTENSION
Alvaro Herrera <alvherre@alvh.no-ip.org>
Avoid duplicates in ALTER ... DEPENDS ON EXTENSION If the command is attempted for an extension that the object already depends on, silently do nothing. In particular, this means that if a database containing multiple such entries is dumped, the restore will silently do the right thing and record just the first one. (At least, in a world where pg_dump does dump such entries -- which it doesn't currently, but it will.) Backpatch to 9.6, where this kind of dependency was introduced. Reviewed-by: Ibrar Ahmed, Tom Lane (offlist) Discussion: https://postgr.es/m/20200217225333.GA30974@alvherre.pgsql
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/catalog/pg_depend.c | modified | +43 −0 |
| src/backend/commands/alter.c | modified | +6 −1 |
| src/include/catalog/dependency.h | modified | +1 −0 |
| src/test/modules/test_extensions/expected/test_extdepend.out | modified | +2 −0 |
| src/test/modules/test_extensions/sql/test_extdepend.sql | modified | +2 −0 |
Discussion
- more ALTER .. DEPENDS ON EXTENSION fixes 17 messages · 2020-02-17 → 2020-04-20