Skip to content

Commit

Permalink
Add documentation for declarative partitioning
Browse files Browse the repository at this point in the history
  • Loading branch information
ildus committed Oct 4, 2018
1 parent e06bbc7 commit afdf2f5
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ More interesting features are yet to come. Stay tuned!
* Non-blocking [concurrent table partitioning](#data-migration);
* FDW support (foreign partitions);
* Various [GUC](#disabling-pg_pathman) toggles and configurable settings.
* Partial support of [`declarative partitioning`](#declarative-partitioning) (from PostgreSQL 10).

## Installation guide
To install `pg_pathman`, execute this in the module's directory:
Expand Down Expand Up @@ -410,6 +411,26 @@ AS SELECT * FROM @[email protected]_cache_stats();
```
Shows memory consumption of various caches.

## Declarative partitioning

From PostgreSQL 10 `ATTACH PARTITION`, `DETACH PARTITION`
and `CREATE TABLE .. PARTITION OF` commands could be with with tables

This comment has been minimized.

Copy link
@funbringer

funbringer Oct 6, 2018

Collaborator

@ildus there's a typo: with with.

This comment has been minimized.

Copy link
@ildus

ildus Oct 8, 2018

Author Collaborator

thanks! fixed in a6bd7b4

partitioned by `pg_pathman`:

```plpgsql
CREATE TABLE child1 (LIKE partitioned_table);

--- attach new partition
ALTER TABLE partitioned_table ATTACH PARTITION child1
FOR VALUES FROM ('2015-05-01') TO ('2015-06-01');

--- detach the partition
ALTER TABLE partitioned_table DETACH PARTITION child1;

-- create a partition
CREATE TABLE child2 PARTITION OF partitioned_table
FOR VALUES IN ('2015-05-01', '2015-06-01');
```

## Custom plan nodes
`pg_pathman` provides a couple of [custom plan nodes](https://wiki.postgresql.org/wiki/CustomScanAPI) which aim to reduce execution time, namely:
Expand Down

0 comments on commit afdf2f5

Please sign in to comment.