Skip to content

Commit c746358

Browse files
committed
pathman: documentation stub
1 parent 12f7198 commit c746358

File tree

3 files changed

+128
-2
lines changed

3 files changed

+128
-2
lines changed

contrib/pathman/doc/pathman.sgml

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
<!-- doc/src/sgml/pathman.sgml -->
2+
3+
<sect1 id="pathman" xreflabel="pathman">
4+
<title>pathman</title>
5+
6+
<indexterm zone="pathman">
7+
<primary>pathman</primary>
8+
</indexterm>
9+
10+
<para>
11+
The <filename>pathman</filename> module provides functions ...
12+
</para>
13+
14+
<sect2>
15+
<title>Pathman Concepts</title>
16+
17+
<para>
18+
...
19+
</para>
20+
</sect2>
21+
22+
<sect2>
23+
<title>Functions</title>
24+
25+
<para>
26+
The functions provided by the <filename>pathman</filename> module
27+
are shown in <xref linkend="pathman-func-table">.
28+
</para>
29+
30+
<table id="pathman-func-table">
31+
<title><filename>pathman</filename> Functions</title>
32+
<tgroup cols="3">
33+
<thead>
34+
<row>
35+
<entry>Function</entry>
36+
<entry>Description</entry>
37+
</row>
38+
</thead>
39+
40+
<tbody>
41+
<row>
42+
<entry><function>create_hash_partitions(text, text, integer)</function><indexterm><primary>create_hash_partitions</primary></indexterm></entry>
43+
<entry>
44+
Creates child partitions for HASH partitioning and trigger on insert. Arguments specifies parent relation name, attribute name and number of desired partitions.
45+
</entry>
46+
</row>
47+
48+
<row>
49+
<entry><function>create_range_partitions(text, text, anyelement, anyelement, integer)</function><indexterm><primary>create_range_partitions</primary></indexterm></entry>
50+
<entry>
51+
Creates child partitions for RANGE partitioning and trigger on insert. Arguments specifies parent relation name, attribute name, start value, interval and number of premade partitions.
52+
</entry>
53+
</row>
54+
55+
<row>
56+
<entry><function>create_range_partitions(text, text, anyelement, interval, integer)</function><indexterm><primary>create_range_partitions</primary></indexterm></entry>
57+
<entry>
58+
Same as above but suited for date or timestamp based partitioning.
59+
</entry>
60+
</row>
61+
62+
<row>
63+
<entry><function>partition_data(text)</function><indexterm><primary>partition_data</primary></indexterm></entry>
64+
<entry>
65+
Copy data from parent table to partitions.
66+
</entry>
67+
</row>
68+
69+
<row>
70+
<entry><function>disable_partitioning(text)</function><indexterm><primary>disable_partitioning</primary></indexterm></entry>
71+
<entry>
72+
Disables pathman for specified relation and removes the trigger.
73+
</entry>
74+
</row>
75+
76+
<row>
77+
<entry><function>split_range_partition(text, anyelement)</function><indexterm><primary>split_range_partition</primary></indexterm></entry>
78+
<entry>
79+
Splits the RANGE partition by the specified value.
80+
</entry>
81+
</row>
82+
83+
<row>
84+
<entry><function>split_range_partition(text, anyelement)</function><indexterm><primary>split_range_partition</primary></indexterm></entry>
85+
<entry>
86+
Merge two adjacent RANGE partitions.
87+
</entry>
88+
</row>
89+
90+
</tbody>
91+
</tgroup>
92+
</table>
93+
</sect2>
94+
95+
<sect2>
96+
<title>Examples</title>
97+
98+
<para>
99+
...
100+
<programlisting>
101+
CREATE TABLE words AS SELECT word FROM
102+
ts_stat('SELECT to_tsvector(''simple'', bodytext) FROM documents');
103+
</programlisting>
104+
</para>
105+
106+
<note>
107+
<para>
108+
...
109+
</para>
110+
</note>
111+
</sect2>
112+
113+
114+
<sect2>
115+
<title>Authors</title>
116+
117+
<para>
118+
Ildar Musin <email>i.musin@postgrespro.ru</email>, Moscow, Postgres Professional Ltd., Russia
119+
</para>
120+
<para>
121+
This module is sponsored by Postgres Professional Ltd., Moscow, Russia.
122+
</para>
123+
</sect2>
124+
125+
</sect1>

contrib/pathman/sql/init.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ RETURNS VOID AS
7373
$$
7474
BEGIN
7575
DELETE FROM pg_pathman_rels WHERE relname = relation;
76+
EXECUTE format('DROP TRIGGER %s_insert_trigger_func ON %1$s', relation);
7677

7778
/* Notify backend about changes */
7879
PERFORM pg_pathman_on_remove_partitions(relation::regclass::integer);

contrib/pathman/sql/range.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ RETURNS VOID AS
546546
$$
547547
DECLARE
548548
v_func TEXT := '
549-
CREATE OR REPLACE FUNCTION %s_range_insert_trigger_func()
549+
CREATE OR REPLACE FUNCTION %s_insert_trigger_func()
550550
RETURNS TRIGGER
551551
AS $body$
552552
DECLARE
@@ -567,7 +567,7 @@ DECLARE
567567
v_trigger TEXT := '
568568
CREATE TRIGGER %s_insert_trigger
569569
BEFORE INSERT ON %1$s
570-
FOR EACH ROW EXECUTE PROCEDURE %1$s_range_insert_trigger_func();';
570+
FOR EACH ROW EXECUTE PROCEDURE %1$s_insert_trigger_func();';
571571
BEGIN
572572
v_func := format(v_func, v_relation, v_attname);
573573
v_trigger := format(v_trigger, v_relation);

0 commit comments

Comments
 (0)