mirror of
https://github.com/postgres/postgres.git
synced 2025-05-03 22:24:49 +03:00
Add ALTER EXTENSION ADD/DROP ACCESS METHOD, and use it in pg_upgrade.
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>
This commit is contained in:
parent
728ceba938
commit
e8bdee2770
@ -30,6 +30,7 @@ ALTER EXTENSION <replaceable class="PARAMETER">name</replaceable> DROP <replacea
|
|||||||
|
|
||||||
<phrase>where <replaceable class="PARAMETER">member_object</replaceable> is:</phrase>
|
<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> ) |
|
AGGREGATE <replaceable class="PARAMETER">aggregate_name</replaceable> ( <replaceable>aggregate_signature</replaceable> ) |
|
||||||
CAST (<replaceable>source_type</replaceable> AS <replaceable>target_type</replaceable>) |
|
CAST (<replaceable>source_type</replaceable> AS <replaceable>target_type</replaceable>) |
|
||||||
COLLATION <replaceable class="PARAMETER">object_name</replaceable> |
|
COLLATION <replaceable class="PARAMETER">object_name</replaceable> |
|
||||||
|
@ -3931,7 +3931,16 @@ alter_extension_opt_item:
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
AlterExtensionContentsStmt:
|
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);
|
AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt);
|
||||||
n->extname = $3;
|
n->extname = $3;
|
||||||
|
@ -12505,6 +12505,9 @@ dumpAccessMethod(Archive *fout, AccessMethodInfo *aminfo)
|
|||||||
appendPQExpBuffer(labelq, "ACCESS METHOD %s",
|
appendPQExpBuffer(labelq, "ACCESS METHOD %s",
|
||||||
qamname);
|
qamname);
|
||||||
|
|
||||||
|
if (dopt->binary_upgrade)
|
||||||
|
binary_upgrade_extension_member(q, &aminfo->dobj, labelq->data);
|
||||||
|
|
||||||
if (aminfo->dobj.dump & DUMP_COMPONENT_DEFINITION)
|
if (aminfo->dobj.dump & DUMP_COMPONENT_DEFINITION)
|
||||||
ArchiveEntry(fout, aminfo->dobj.catId, aminfo->dobj.dumpId,
|
ArchiveEntry(fout, aminfo->dobj.catId, aminfo->dobj.dumpId,
|
||||||
aminfo->dobj.name,
|
aminfo->dobj.name,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user