pgsql: Fix pg_upgrade to handle extensions.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Fix pg_upgrade to handle extensions.
Дата
Msg-id E1PnKEy-0005VX-Rv@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
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.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/caddcb8f4b96ce48b612e7c987ecde654d624616

Modified Files
--------------
contrib/pg_upgrade/function.c                   |   26 +-
contrib/pg_upgrade_support/pg_upgrade_support.c |   73 +++-
src/backend/catalog/objectaddress.c             |    1 +
src/backend/commands/comment.c                  |    1 +
src/backend/commands/extension.c                |   94 +++--
src/backend/parser/gram.y                       |    2 +-
src/bin/pg_dump/common.c                        |    1 +
src/bin/pg_dump/pg_dump.c                       |  521 ++++++++++++++++-------
src/bin/pg_dump/pg_dump.h                       |    3 +
src/include/commands/extension.h                |    5 +
10 files changed, 544 insertions(+), 183 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: pgsql: Information schema views for collation support
Следующее
От: Itagaki Takahiro
Дата:
Сообщение: pgsql: Fix typo in the documentation.