diff options
| author | Alvaro Herrera | 2020-03-11 14:04:59 +0000 |
|---|---|---|
| committer | Alvaro Herrera | 2020-03-11 14:04:59 +0000 |
| commit | 3dfd2d6cd28a125edc4761eaefaa1193f111459d (patch) | |
| tree | fe862692d64574fb2ae7ed1466e55c68b1ebf4ad /src/include/catalog | |
| parent | 475b061c867557499559227d743b332c257033a3 (diff) | |
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
Diffstat (limited to 'src/include/catalog')
| -rw-r--r-- | src/include/catalog/dependency.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/include/catalog/dependency.h b/src/include/catalog/dependency.h index b7502722a27..f9b5d29674d 100644 --- a/src/include/catalog/dependency.h +++ b/src/include/catalog/dependency.h @@ -237,6 +237,7 @@ extern long changeDependencyFor(Oid classId, Oid objectId, Oid newRefObjectId); extern Oid getExtensionOfObject(Oid classId, Oid objectId); +extern List *getAutoExtensionsOfObject(Oid classId, Oid objectId); extern bool sequenceIsOwned(Oid seqId, char deptype, Oid *tableId, int32 *colId); extern List *getOwnedSequences(Oid relid, AttrNumber attnum); |
