git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 728ceba)
Add ALTER EXTENSION ADD/DROP ACCESS METHOD, and use it in pg_upgrade.
Sun, 2 Oct 2016 18:31:28 +0000 (14:31 -0400)
Sun, 2 Oct 2016 18:31:28 +0000 (14:31 -0400)
Without this, an extension containing an access method is not properly
dumped/restored during pg_upgrade --- the AM ends up not being a member
of the extension after upgrading.

Another oversight in commit 473b93287, reported by Andrew Dunstan.

Report: <f7ac29f3-515c-2a44-21c5-ec925053265f@dunslane.net>


diff --git a/doc/src/sgml/ref/alter_extension.sgml b/doc/src/sgml/ref/alter_extension.sgml
index 7141ee352eb5b3796ee5d6edd4d9196c4e99e002..de6d6dca16b054e50c66a1e955958eb5c7b14331 100644 (file)
--- a/doc/src/sgml/ref/alter_extension.sgml
+++ b/doc/src/sgml/ref/alter_extension.sgml
@@ -30,6 +30,7 @@ ALTER EXTENSION <replaceable class="PARAMETER">name</replaceable> DROP <replacea
<phrase>where <replaceable class="PARAMETER">member_object</replaceable> is:</phrase>
+ ACCESS METHOD <replaceable class="PARAMETER">object_name</replaceable> |
AGGREGATE <replaceable class="PARAMETER">aggregate_name</replaceable> ( <replaceable>aggregate_signature</replaceable> ) |
CAST (<replaceable>source_type</replaceable> AS <replaceable>target_type</replaceable>) |
COLLATION <replaceable class="PARAMETER">object_name</replaceable> |
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index 1526c73a1c52c103d31b24203899ff2fda0d16ff..5547fc86586ae54a082734c9686e14f021bbc47f 100644 (file)
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -3931,7 +3931,16 @@ alter_extension_opt_item:
*****************************************************************************/
AlterExtensionContentsStmt:
- ALTER EXTENSION name add_drop AGGREGATE func_name aggr_args
+ ALTER EXTENSION name add_drop ACCESS METHOD name
+ {
+ AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt);
+ n->extname = 3ドル;
+ n->action = 4ドル;
+ n->objtype = OBJECT_ACCESS_METHOD;
+ n->objname = list_make1(makeString(7ドル));
+ $$ = (Node *)n;
+ }
+ | ALTER EXTENSION name add_drop AGGREGATE func_name aggr_args
{
AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt);
n->extname = 3ドル;
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 51b8a1a62251557c24cbac03de1d5f0b79af494c..299e88788e18811ff021e4addcac86b8365b05f7 100644 (file)
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -12505,6 +12505,9 @@ dumpAccessMethod(Archive *fout, AccessMethodInfo *aminfo)
appendPQExpBuffer(labelq, "ACCESS METHOD %s",
qamname);
+ if (dopt->binary_upgrade)
+ binary_upgrade_extension_member(q, &aminfo->dobj, labelq->data);
+
if (aminfo->dobj.dump & DUMP_COMPONENT_DEFINITION)
ArchiveEntry(fout, aminfo->dobj.catId, aminfo->dobj.dumpId,
aminfo->dobj.name,
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /