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

Commit6c2e734

Browse files
committed
Refactor ALTER EXTENSION UPDATE to have cleaner multi-step semantics.
This change causes a multi-step update sequence to behave exactly as if theupdates had been commanded one at a time, including updating the "requires"dependencies afresh at each step. The initial implementation took theshortcut of examining only the final target version's "requires" andchanging the catalog entry but once. But on reflection that's a bad idea,since it could lead to executing old update scripts under conditionsdifferent than they were designed/tested for. Better to expend a few extracycles and avoid any surprises.In the same spirit, if a CREATE EXTENSION FROM operation involves applyinga series of update files, it will act as though the CREATE had first beendone using the initial script's target version and then the additionalscripts were invoked with ALTER EXTENSION UPDATE.I also removed the restriction about not changing encoding in secondarycontrol files. The new rule is that a script is assumed to be in whateverencoding the control file(s) specify for its target version. Since thisreimplementation causes us to read each intermediate version's controlfile, there's no longer any uncertainty about which encoding setting wouldget applied.
1 parent0de0cc1 commit6c2e734

File tree

2 files changed

+252
-144
lines changed

2 files changed

+252
-144
lines changed

‎doc/src/sgml/extend.sgml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -482,10 +482,8 @@
482482
Secondary control files follow the same format as the primary control
483483
file. Any parameters set in a secondary control file override the
484484
primary control file when installing or updating to that version of
485-
the extension. However, the parameters <varname>directory</>,
486-
<varname>default_version</>, and <varname>encoding</> cannot be set in
487-
a secondary control file; in particular, the same encoding must be used
488-
in all script files associated with the extension.
485+
the extension. However, the parameters <varname>directory</> and
486+
<varname>default_version</> cannot be set in a secondary control file.
489487
</para>
490488

491489
<para>
@@ -689,6 +687,12 @@ SELECT pg_catalog.pg_extension_config_dump('my_config', 'WHERE NOT standard_entr
689687
to the extension.
690688
</para>
691689

690+
<para>
691+
If an extension has secondary control files, the control parameters
692+
that are used for an update script are those associated with the script's
693+
target (new) version.
694+
</para>
695+
692696
<para>
693697
The update mechanism can be used to solve an important special case:
694698
converting a <quote>loose</> collection of objects into an extension.
@@ -808,7 +812,7 @@ include $(PGXS)
808812

809813
This makefile relies on <acronym>PGXS</acronym>, which is described
810814
in <xref linkend="extend-pgxs">. The command <literal>make install</>
811-
willtheninstall the control and script files into the correct
815+
will install the control and script files into the correct
812816
directory as reported by <application>pg_config</>.
813817
</para>
814818

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp