Skip to content

Commit a5430d9

Browse files
committed
[Doc]: update pgpathman.sgml
1 parent 86c7dac commit a5430d9

File tree

1 file changed

+25
-8
lines changed

1 file changed

+25
-8
lines changed

doc/src/sgml/pgpathman.sgml

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ CREATE EXTENSION pg_pathman;
140140
create_hash_partitions(relation REGCLASS,
141141
attribute TEXT,
142142
partitions_count INTEGER,
143-
partition_name TEXT DEFAULT NULL,
144143
partition_data BOOLEAN DEFAULT TRUE)
145144
</programlisting>
146145
<para>
@@ -154,8 +153,8 @@ create_hash_partitions(relation REGCLASS,
154153
to finish and the table will be locked until transaction
155154
commits. See <literal>partition_table_concurrently()</literal>
156155
for a lock-free way to migrate data. Partition creation callback
157-
is invoked for each partition if set beforehand (see
158-
<literal>set_part_init_callback()</literal>).
156+
is invoked for each partition if set beforehand
157+
(see <literal>set_init_callback()</literal>).
159158
</para>
160159
<programlisting>
161160
create_range_partitions(relation REGCLASS,
@@ -243,6 +242,17 @@ create_range_update_trigger(parent REGCLASS)
243242
</sect3>
244243
<sect3 id="post-creation-partition-management">
245244
<title>Post-creation partition management</title>
245+
<programlisting>
246+
replace_hash_partition(old_partition REGCLASS,
247+
new_partition REGCLASS,
248+
lock_parent BOOL DEFAULT TRUE)
249+
</programlisting>
250+
<para>
251+
Replaces specified partition of HASH-partitioned table with another table.
252+
The <literal>lock_parent</literal> parameter will prevent any INSERT/UPDATE/ALTER TABLE
253+
queries to parent table.
254+
</para>
255+
246256
<programlisting>
247257
split_range_partition(partition REGCLASS,
248258
value ANYELEMENT,
@@ -390,7 +400,15 @@ set_init_callback(relation REGCLASS, callback REGPROC DEFAULT 0)
390400
&quot;parttype&quot;: &quot;1&quot;,
391401
&quot;partition&quot;: &quot;abc_0&quot;
392402
}
393-
</programlisting>
403+
</programlisting>
404+
<programlisting>
405+
set_set_spawn_using_bgw(relation REGCLASS, value BOOLEAN)
406+
</programlisting>
407+
<para>
408+
When INSERTing new data beyond the partitioning range,
409+
use SpawnPartitionsWorker to create new partitions in a
410+
separate transaction.
411+
</para>
394412
</sect3>
395413
</sect2>
396414
<sect2 id="views-and-tables">
@@ -403,9 +421,7 @@ CREATE TABLE IF NOT EXISTS pathman_config (
403421
partrel REGCLASS NOT NULL PRIMARY KEY,
404422
attname TEXT NOT NULL,
405423
parttype INTEGER NOT NULL,
406-
range_interval TEXT,
407-
408-
CHECK (parttype IN (1, 2)) /* check for allowed part types */ );
424+
range_interval TEXT);
409425
</programlisting>
410426
<para>
411427
This table stores a list of partitioned tables.
@@ -419,7 +435,8 @@ CREATE TABLE IF NOT EXISTS pathman_config_params (
419435
partrel REGCLASS NOT NULL PRIMARY KEY,
420436
enable_parent BOOLEAN NOT NULL DEFAULT TRUE,
421437
auto BOOLEAN NOT NULL DEFAULT TRUE,
422-
init_callback REGPROCEDURE NOT NULL DEFAULT 0);
438+
init_callback REGPROCEDURE NOT NULL DEFAULT 0,
439+
spawn_using_bgw BOOLEAN NOT NULL DEFAULT FALSE);
423440
</programlisting>
424441
<para>
425442
This table stores optional parameters which override standard

0 commit comments

Comments
 (0)