@@ -120,7 +120,7 @@ Merge two adjacent RANGE partitions. Data from `partition2` is copied to `partit
120120```
121121append_range_partition(p_relation TEXT)
122122```
123- Appends new RANGE partition and returns
123+ Appends new RANGE partition and returns
124124```
125125prepend_range_partition(p_relation TEXT)
126126```
@@ -160,6 +160,13 @@ disable_partitioning(relation TEXT)
160160Disables ` pg_pathman ` partitioning mechanism for the specified parent table and removes an insert trigger. Partitions itself remain unchanged.
161161
162162## Examples
163+
164+ ### Common tips
165+ You can easily add ** _ partition_ ** column containing the names of the underlying partitions using the system attribute called ** _ tableoid_ ** :
166+ ```
167+ SELECT tableoid::regclass, * AS partition FROM partitioned_table;
168+ ```
169+
163170### HASH
164171Consider an example of HASH partitioning. First create a table with some integer column:
165172```
@@ -180,13 +187,13 @@ This will create new partitions and move the data from parent to partitions.
180187Here is an example of the query with filtering by partitioning key and its plan:
181188```
182189SELECT * FROM items WHERE id = 1234;
183- id | name | code
190+ id | name | code
184191------+----------------------------------+------
185192 1234 | 81dc9bdb52d04dc20036dbd8313ed055 | 1855
186193(1 row)
187194
188195EXPLAIN SELECT * FROM items WHERE id = 1234;
189- QUERY PLAN
196+ QUERY PLAN
190197------------------------------------------------------------------------------------
191198 Append (cost=0.28..8.29 rows=0 width=0)
192199 -> Index Scan using items_34_pkey on items_34 (cost=0.28..8.29 rows=0 width=0)
@@ -195,7 +202,7 @@ EXPLAIN SELECT * FROM items WHERE id = 1234;
195202Note that pg_pathman excludes parent table from the query plan. To access parent table use ONLY modifier:
196203```
197204EXPLAIN SELECT * FROM ONLY items;
198- QUERY PLAN
205+ QUERY PLAN
199206------------------------------------------------------
200207 Seq Scan on items (cost=0.00..0.00 rows=1 width=45)
201208```
0 commit comments