Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite8bdee2

Browse files
committed
Add ALTER EXTENSION ADD/DROP ACCESS METHOD, and use it in pg_upgrade.
Without this, an extension containing an access method is not properlydumped/restored during pg_upgrade --- the AM ends up not being a memberof the extension after upgrading.Another oversight in commit473b932, reported by Andrew Dunstan.Report: <f7ac29f3-515c-2a44-21c5-ec925053265f@dunslane.net>
1 parent728ceba commite8bdee2

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

‎doc/src/sgml/ref/alter_extension.sgml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ ALTER EXTENSION <replaceable class="PARAMETER">name</replaceable> DROP <replacea
3030

3131
<phrase>where <replaceable class="PARAMETER">member_object</replaceable> is:</phrase>
3232

33+
ACCESS METHOD <replaceable class="PARAMETER">object_name</replaceable> |
3334
AGGREGATE <replaceable class="PARAMETER">aggregate_name</replaceable> ( <replaceable>aggregate_signature</replaceable> ) |
3435
CAST (<replaceable>source_type</replaceable> AS <replaceable>target_type</replaceable>) |
3536
COLLATION <replaceable class="PARAMETER">object_name</replaceable> |

‎src/backend/parser/gram.y

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3931,7 +3931,16 @@ alter_extension_opt_item:
39313931
*****************************************************************************/
39323932

39333933
AlterExtensionContentsStmt:
3934-
ALTEREXTENSIONnameadd_dropAGGREGATEfunc_nameaggr_args
3934+
ALTEREXTENSIONnameadd_dropACCESSMETHODname
3935+
{
3936+
AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt);
3937+
n->extname =$3;
3938+
n->action =$4;
3939+
n->objtype = OBJECT_ACCESS_METHOD;
3940+
n->objname = list_make1(makeString($7));
3941+
$$ = (Node *)n;
3942+
}
3943+
|ALTEREXTENSIONnameadd_dropAGGREGATEfunc_nameaggr_args
39353944
{
39363945
AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt);
39373946
n->extname =$3;

‎src/bin/pg_dump/pg_dump.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12505,6 +12505,9 @@ dumpAccessMethod(Archive *fout, AccessMethodInfo *aminfo)
1250512505
appendPQExpBuffer(labelq, "ACCESS METHOD %s",
1250612506
qamname);
1250712507

12508+
if (dopt->binary_upgrade)
12509+
binary_upgrade_extension_member(q, &aminfo->dobj, labelq->data);
12510+
1250812511
if (aminfo->dobj.dump & DUMP_COMPONENT_DEFINITION)
1250912512
ArchiveEntry(fout, aminfo->dobj.catId, aminfo->dobj.dumpId,
1251012513
aminfo->dobj.name,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp