postgresql/src/backend
Tom Lane e5bc9454e5 Explicitly list dependent types as extension members in pg_depend.
Auto-generated array types, multirange types, and relation rowtypes
are treated as dependent objects: they can't be dropped separately
from the base object, nor can they have their own ownership or
permissions.  We previously felt that, for objects that are in an
extension, only the base object needs to be listed as an extension
member in pg_depend.  While that's sufficient to prevent inappropriate
drops, it results in undesirable answers if someone asks whether a
dependent type belongs to the extension.  It looks like the dependent
type is just some random separately-created object that happens to
depend on the base object.  Notably, this results in postgres_fdw
concluding that expressions involving an array type are not shippable
to the remote server, even when the defining extension has been
whitelisted.

To fix, cause GenerateTypeDependencies to make extension dependencies
for dependent types as well as their base objects, and adjust
ExecAlterExtensionContentsStmt so that object addition and removal
operations recurse to dependent types.  The latter change means that
pg_upgrade of a type-defining extension will end with the dependent
type(s) now also listed as extension members, even if they were
not that way in the source database.  Normally we want pg_upgrade
to precisely reproduce the source extension's state, but it seems
desirable to make an exception here.

This is arguably a bug fix, but we can't back-patch it since it
causes changes in the expected contents of pg_depend.  (Because
it does, I've bumped catversion, even though there's no change
in the immediate post-initdb catalog contents.)

Tom Lane and David Geier

Discussion: https://postgr.es/m/4a847c55-489f-4e8d-a664-fc6b1cbe306f@gmail.com
2024-03-04 14:49:36 -05:00
..
access Rework locking code in GetMultiXactIdMembers 2024-03-04 17:48:01 +01:00
archive Update copyright for 2024 2024-01-03 20:49:05 -05:00
backup Fix pgindent damage. 2024-03-04 14:37:35 -05:00
bootstrap Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
catalog Explicitly list dependent types as extension members in pg_depend. 2024-03-04 14:49:36 -05:00
commands Explicitly list dependent types as extension members in pg_depend. 2024-03-04 14:49:36 -05:00
executor Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
foreign Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
jit Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
lib Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
libpq Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
main Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
nodes Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
optimizer Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
parser Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
partitioning Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
po Update copyright for 2024 2024-01-03 20:49:05 -05:00
port Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
postmaster Fix pgindent damage. 2024-03-04 14:37:35 -05:00
regex Update copyright for 2024 2024-01-03 20:49:05 -05:00
replication Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
rewrite Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
snowball Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
statistics Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
storage Put back required #include 2024-03-04 13:17:37 +01:00
tcop Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
tsearch Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
utils Remove the adminpack contrib extension 2024-03-04 12:39:22 +01:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Blind attempt to fix LLVM dependency in the backend 2022-09-15 10:53:48 +07:00
Makefile Remove AIX support 2024-02-28 15:17:23 +04:00
meson.build Remove AIX support 2024-02-28 15:17:23 +04:00
nls.mk Remove distprep 2023-11-06 15:18:04 +01:00