-
- Downloads
Fix pg_upgrade to handle extensions.
This follows my proposal of yesterday, namely that we try to recreate the previous state of the extension exactly, instead of allowing CREATE EXTENSION to run a SQL script that might create some entirely-incompatible on-disk state. In --binary-upgrade mode, pg_dump won't issue CREATE EXTENSION at all, but instead uses a kluge function provided by pg_upgrade_support to recreate the pg_extension row (and extension-level pg_depend entries) without creating any member objects. The member objects are then restored in the same way as if they weren't members, in particular using pg_upgrade's normal hacks to preserve OIDs that need to be preserved. Then, for each member object, ALTER EXTENSION ADD is issued to recreate the pg_depend entry that marks it as an extension member. In passing, fix breakage in pg_upgrade's enum-type support: somebody didn't fix it when the noise word VALUE got added to ALTER TYPE ADD. Also, rationalize parsetree representation of COMMENT ON DOMAIN and fix get_object_address() to allow OBJECT_DOMAIN.
Showing
- contrib/pg_upgrade/function.c 16 additions, 10 deletionscontrib/pg_upgrade/function.c
- contrib/pg_upgrade_support/pg_upgrade_support.c 71 additions, 2 deletionscontrib/pg_upgrade_support/pg_upgrade_support.c
- src/backend/catalog/objectaddress.c 1 addition, 0 deletionssrc/backend/catalog/objectaddress.c
- src/backend/commands/comment.c 1 addition, 0 deletionssrc/backend/commands/comment.c
- src/backend/commands/extension.c 68 additions, 26 deletionssrc/backend/commands/extension.c
- src/backend/parser/gram.y 1 addition, 1 deletionsrc/backend/parser/gram.y
- src/bin/pg_dump/common.c 1 addition, 0 deletionssrc/bin/pg_dump/common.c
- src/bin/pg_dump/pg_dump.c 377 additions, 144 deletionssrc/bin/pg_dump/pg_dump.c
- src/bin/pg_dump/pg_dump.h 3 additions, 0 deletionssrc/bin/pg_dump/pg_dump.h
- src/include/commands/extension.h 5 additions, 0 deletionssrc/include/commands/extension.h
Loading
Please register or sign in to comment