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

Commit73a6005

Browse files
committed
Doc: warn against using parallel restore with --load-via-partition-root.
This isn't terribly safe, and making it so doesn't seem like a smallproject, so for the moment just warn against it.Discussion:https://postgr.es/m/13624.1535486019@sss.pgh.pa.us
1 parent89b280e commit73a6005

File tree

2 files changed

+36
-16
lines changed

2 files changed

+36
-16
lines changed

‎doc/src/sgml/ref/pg_dump.sgml

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -793,13 +793,26 @@ PostgreSQL documentation
793793
<term><option>--load-via-partition-root</option></term>
794794
<listitem>
795795
<para>
796-
When dumping a <command>COPY</command> or <command>INSERT</command> statement for a partitioned table,
797-
target the root of the partitioning hierarchy which contains it rather
798-
than the partition itself. This may be useful when reloading data on
799-
a server where rows do not always fall into the same partitions as
800-
they did on the original server. This could happen, for example, if
801-
the partitioning column is of type text and the two system have
802-
different definitions of the collation used to partition the data.
796+
When dumping data for a table partition, make
797+
the <command>COPY</command> or <command>INSERT</command> statements
798+
target the root of the partitioning hierarchy that contains it, rather
799+
than the partition itself. This causes the appropriate partition to
800+
be re-determined for each row when the data is loaded. This may be
801+
useful when reloading data on a server where rows do not always fall
802+
into the same partitions as they did on the original server. That
803+
could happen, for example, if the partitioning column is of type text
804+
and the two systems have different definitions of the collation used
805+
to sort the partitioning column.
806+
</para>
807+
808+
<para>
809+
It is best not to use parallelism when restoring from an archive made
810+
with this option, because <application>pg_restore</application> will
811+
not know exactly which partition(s) a given archive data item will
812+
load data into. This could result in inefficiency due to lock
813+
conflicts between parallel jobs, or perhaps even reload failures due
814+
to foreign key constraints being set up before all the relevant data
815+
is loaded.
803816
</para>
804817
</listitem>
805818
</varlistentry>
@@ -915,7 +928,7 @@ PostgreSQL documentation
915928
<para>
916929
Add <literal>ON CONFLICT DO NOTHING</literal> to
917930
<command>INSERT</command> commands.
918-
This option is not valid unless <option>--inserts</option> or
931+
This option is not valid unless <option>--inserts</option> or
919932
<option>--column-inserts</option> is also specified.
920933
</para>
921934
</listitem>

‎doc/src/sgml/ref/pg_dumpall.sgml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -330,14 +330,21 @@ PostgreSQL documentation
330330
<term><option>--load-via-partition-root</option></term>
331331
<listitem>
332332
<para>
333-
When dumping a <command>COPY</command> or <command>INSERT</command> statement for a partitioned table,
334-
target the root of the partitioning hierarchy which contains it rather
335-
than the partition itself. This may be useful when reloading data on
336-
a server where rows do not always fall into the same partitions as
337-
they did on the original server. This could happen, for example, if
338-
the partitioning column is of type text and the two system have
339-
different definitions of the collation used to partition the data.
333+
When dumping data for a table partition, make
334+
the <command>COPY</command> or <command>INSERT</command> statements
335+
target the root of the partitioning hierarchy that contains it, rather
336+
than the partition itself. This causes the appropriate partition to
337+
be re-determined for each row when the data is loaded. This may be
338+
useful when reloading data on a server where rows do not always fall
339+
into the same partitions as they did on the original server. That
340+
could happen, for example, if the partitioning column is of type text
341+
and the two systems have different definitions of the collation used
342+
to sort the partitioning column.
340343
</para>
344+
345+
<!-- Currently, we don't need pg_dump's warning about parallelism here,
346+
since parallel restore from a pg_dumpall script is impossible.
347+
-->
341348
</listitem>
342349
</varlistentry>
343350

@@ -452,7 +459,7 @@ PostgreSQL documentation
452459
<para>
453460
Add <literal>ON CONFLICT DO NOTHING</literal> to
454461
<command>INSERT</command> commands.
455-
This option is not valid unless <option>--inserts</option> or
462+
This option is not valid unless <option>--inserts</option> or
456463
<option>--column-inserts</option> is also specified.
457464
</para>
458465
</listitem>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp