@@ -140,7 +140,6 @@ CREATE EXTENSION pg_pathman;
140
140
create_hash_partitions(relation REGCLASS,
141
141
attribute TEXT,
142
142
partitions_count INTEGER,
143
- partition_name TEXT DEFAULT NULL,
144
143
partition_data BOOLEAN DEFAULT TRUE)
145
144
</programlisting>
146
145
<para>
@@ -154,8 +153,8 @@ create_hash_partitions(relation REGCLASS,
154
153
to finish and the table will be locked until transaction
155
154
commits. See <literal>partition_table_concurrently()</literal>
156
155
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>).
159
158
</para>
160
159
<programlisting>
161
160
create_range_partitions(relation REGCLASS,
@@ -243,6 +242,17 @@ create_range_update_trigger(parent REGCLASS)
243
242
</sect3>
244
243
<sect3 id="post-creation-partition-management">
245
244
<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
+
246
256
<programlisting>
247
257
split_range_partition(partition REGCLASS,
248
258
value ANYELEMENT,
@@ -390,7 +400,15 @@ set_init_callback(relation REGCLASS, callback REGPROC DEFAULT 0)
390
400
"parttype": "1",
391
401
"partition": "abc_0"
392
402
}
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>
394
412
</sect3>
395
413
</sect2>
396
414
<sect2 id="views-and-tables">
@@ -403,9 +421,7 @@ CREATE TABLE IF NOT EXISTS pathman_config (
403
421
partrel REGCLASS NOT NULL PRIMARY KEY,
404
422
attname TEXT NOT NULL,
405
423
parttype INTEGER NOT NULL,
406
- range_interval TEXT,
407
-
408
- CHECK (parttype IN (1, 2)) /* check for allowed part types */ );
424
+ range_interval TEXT);
409
425
</programlisting>
410
426
<para>
411
427
This table stores a list of partitioned tables.
@@ -419,7 +435,8 @@ CREATE TABLE IF NOT EXISTS pathman_config_params (
419
435
partrel REGCLASS NOT NULL PRIMARY KEY,
420
436
enable_parent BOOLEAN NOT NULL DEFAULT TRUE,
421
437
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);
423
440
</programlisting>
424
441
<para>
425
442
This table stores optional parameters which override standard
0 commit comments