From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | pgsql-committers(at)postgresql(dot)org |
Subject: | pgsql: Fix pg_upgrade to handle extensions. |
Date: | 2011-02-10 00:18:32 |
Message-ID: | E1PnKEy-0005VX-Rv@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Itagaki Takahiro | 2011-02-10 01:59:44 | pgsql: Fix typo in the documentation. |
Previous Message | Peter Eisentraut | 2011-02-09 21:30:32 | pgsql: Information schema views for collation support |