pg_fkpart

pg_fkpart

pg_fkpart : Table partitioning by foreign key utility

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
2500
pg_fkpart
pg_fkpart
1.7.0
OLAP
GPL-2.0
SQL
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
----d--
No
No
No
Yes
no
no
Relationships
Schemaspgfkpart
See Also
citus
pg_partman
timescaledb
periods
temporal_tables
btree_gist
emaj
table_version

Packages

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
EXT
MIXED
1.7.0
18
17
16
15
14
pg_fkpart-
RPM
PIGSTY
1.7.0
18
17
16
15
14
pg_fkpart_$v-
DEB
PIGSTY
1.7.0
18
17
16
15
14
postgresql-$v-pg-fkpart-
Linux / PGPG18PG17PG16PG15PG14
el8.x86_64
PGDG 1.7.0
PGDG 1.7.0
PGDG 1.7.0
PGDG 1.7.0
PGDG 1.7.0
el8.aarch64
PGDG 1.7.0
PGDG 1.7.0
PGDG 1.7.0
PGDG 1.7.0
PGDG 1.7.0
el9.x86_64
PGDG 1.7.0
PGDG 1.7.0
PGDG 1.7.0
PGDG 1.7.0
PGDG 1.7.0
el9.aarch64
PGDG 1.7.0
PGDG 1.7.0
PGDG 1.7.0
PGDG 1.7.0
PGDG 1.7.0
el10.x86_64
PGDG 1.7.0
PGDG 1.7.0
PGDG 1.7.0
PGDG 1.7.0
PGDG 1.7.0
el10.aarch64
PGDG 1.7.0
PGDG 1.7.0
PGDG 1.7.0
PGDG 1.7.0
PGDG 1.7.0
d12.x86_64
PIGSTY 1.7.0
PIGSTY 1.7.0
PIGSTY 1.7.0
PIGSTY 1.7.0
PIGSTY 1.7.0
d12.aarch64
PIGSTY 1.7.0
PIGSTY 1.7.0
PIGSTY 1.7.0
PIGSTY 1.7.0
PIGSTY 1.7.0
d13.x86_64
PIGSTY 1.7.0
PIGSTY 1.7.0
PIGSTY 1.7.0
PIGSTY 1.7.0
PIGSTY 1.7.0
d13.aarch64
PIGSTY 1.7.0
PIGSTY 1.7.0
PIGSTY 1.7.0
PIGSTY 1.7.0
PIGSTY 1.7.0
u22.x86_64
PIGSTY 1.7.0
PIGSTY 1.7.0
PIGSTY 1.7.0
PIGSTY 1.7.0
PIGSTY 1.7.0
u22.aarch64
PIGSTY 1.7.0
PIGSTY 1.7.0
PIGSTY 1.7.0
PIGSTY 1.7.0
PIGSTY 1.7.0
u24.x86_64
PIGSTY 1.7.0
PIGSTY 1.7.0
PIGSTY 1.7.0
PIGSTY 1.7.0
PIGSTY 1.7.0
u24.aarch64
PIGSTY 1.7.0
PIGSTY 1.7.0
PIGSTY 1.7.0
PIGSTY 1.7.0
PIGSTY 1.7.0
PackageVersionOSORGSIZEFile URL
pg_fkpart_171.7.0el8.x86_64pgdg24.4 KiBpg_fkpart_17-1.7.0-6PGDG.rhel8.noarch.rpm
pg_fkpart_171.7.0el8.x86_64pigsty23.1 KiBpg_fkpart_17-1.7.0-1PIGSTY.el8.x86_64.rpm
pg_fkpart_171.7.0el8.aarch64pgdg24.3 KiBpg_fkpart_17-1.7.0-6PGDG.rhel8.noarch.rpm
pg_fkpart_171.7.0el8.aarch64pigsty23.1 KiBpg_fkpart_17-1.7.0-1PIGSTY.el8.aarch64.rpm
pg_fkpart_171.7.0el9.x86_64pgdg22.9 KiBpg_fkpart_17-1.7.0-6PGDG.rhel9.noarch.rpm
pg_fkpart_171.7.0el9.x86_64pigsty22.6 KiBpg_fkpart_17-1.7.0-1PIGSTY.el9.x86_64.rpm
pg_fkpart_171.7.0el9.aarch64pgdg22.8 KiBpg_fkpart_17-1.7.0-6PGDG.rhel9.noarch.rpm
pg_fkpart_171.7.0el9.aarch64pigsty22.6 KiBpg_fkpart_17-1.7.0-1PIGSTY.el9.aarch64.rpm
pg_fkpart_171.7.0el10.x86_64pgdg23.4 KiBpg_fkpart_17-1.7.0-6PGDG.rhel10.noarch.rpm
pg_fkpart_171.7.0el10.aarch64pgdg23.3 KiBpg_fkpart_17-1.7.0-6PGDG.rhel10.noarch.rpm
postgresql-17-pg-fkpart1.7.0d12.x86_64pigsty15.4 KiBpostgresql-17-pg-fkpart_1.7.0-1PIGSTY~bookworm_amd64.deb
postgresql-17-pg-fkpart1.7.0d12.aarch64pigsty15.4 KiBpostgresql-17-pg-fkpart_1.7.0-1PIGSTY~bookworm_arm64.deb
postgresql-17-pg-fkpart1.7.0d13.x86_64pigsty15.4 KiBpostgresql-17-pg-fkpart_1.7.0-1PIGSTY~trixie_amd64.deb
postgresql-17-pg-fkpart1.7.0d13.aarch64pigsty15.4 KiBpostgresql-17-pg-fkpart_1.7.0-1PIGSTY~trixie_arm64.deb
postgresql-17-pg-fkpart1.7.0u22.x86_64pigsty15.7 KiBpostgresql-17-pg-fkpart_1.7.0-1PIGSTY~jammy_amd64.deb
postgresql-17-pg-fkpart1.7.0u22.aarch64pigsty15.7 KiBpostgresql-17-pg-fkpart_1.7.0-1PIGSTY~jammy_arm64.deb
postgresql-17-pg-fkpart1.7.0u24.x86_64pigsty15.6 KiBpostgresql-17-pg-fkpart_1.7.0-1PIGSTY~noble_amd64.deb
postgresql-17-pg-fkpart1.7.0u24.aarch64pigsty15.6 KiBpostgresql-17-pg-fkpart_1.7.0-1PIGSTY~noble_arm64.deb
PackageVersionOSORGSIZEFile URL
pg_fkpart_161.7.0el8.x86_64pgdg24.2 KiBpg_fkpart_16-1.7.0-4.rhel8.noarch.rpm
pg_fkpart_161.7.0el8.x86_64pigsty23.1 KiBpg_fkpart_16-1.7.0-1PIGSTY.el8.x86_64.rpm
pg_fkpart_161.7.0el8.aarch64pgdg24.1 KiBpg_fkpart_16-1.7.0-4.rhel8.noarch.rpm
pg_fkpart_161.7.0el8.aarch64pigsty23.1 KiBpg_fkpart_16-1.7.0-1PIGSTY.el8.aarch64.rpm
pg_fkpart_161.7.0el9.x86_64pgdg22.8 KiBpg_fkpart_16-1.7.0-4.rhel9.noarch.rpm
pg_fkpart_161.7.0el9.x86_64pigsty22.6 KiBpg_fkpart_16-1.7.0-1PIGSTY.el9.x86_64.rpm
pg_fkpart_161.7.0el9.aarch64pgdg22.6 KiBpg_fkpart_16-1.7.0-4.rhel9.noarch.rpm
pg_fkpart_161.7.0el9.aarch64pigsty22.6 KiBpg_fkpart_16-1.7.0-1PIGSTY.el9.aarch64.rpm
pg_fkpart_161.7.0el10.x86_64pgdg23.4 KiBpg_fkpart_16-1.7.0-6PGDG.rhel10.noarch.rpm
pg_fkpart_161.7.0el10.aarch64pgdg23.3 KiBpg_fkpart_16-1.7.0-6PGDG.rhel10.noarch.rpm
postgresql-16-pg-fkpart1.7.0d12.x86_64pigsty15.4 KiBpostgresql-16-pg-fkpart_1.7.0-1PIGSTY~bookworm_amd64.deb
postgresql-16-pg-fkpart1.7.0d12.aarch64pigsty15.4 KiBpostgresql-16-pg-fkpart_1.7.0-1PIGSTY~bookworm_arm64.deb
postgresql-16-pg-fkpart1.7.0d13.x86_64pigsty15.4 KiBpostgresql-16-pg-fkpart_1.7.0-1PIGSTY~trixie_amd64.deb
postgresql-16-pg-fkpart1.7.0d13.aarch64pigsty15.4 KiBpostgresql-16-pg-fkpart_1.7.0-1PIGSTY~trixie_arm64.deb
postgresql-16-pg-fkpart1.7.0u22.x86_64pigsty15.7 KiBpostgresql-16-pg-fkpart_1.7.0-1PIGSTY~jammy_amd64.deb
postgresql-16-pg-fkpart1.7.0u22.aarch64pigsty15.7 KiBpostgresql-16-pg-fkpart_1.7.0-1PIGSTY~jammy_arm64.deb
postgresql-16-pg-fkpart1.7.0u24.x86_64pigsty15.6 KiBpostgresql-16-pg-fkpart_1.7.0-1PIGSTY~noble_amd64.deb
postgresql-16-pg-fkpart1.7.0u24.aarch64pigsty15.6 KiBpostgresql-16-pg-fkpart_1.7.0-1PIGSTY~noble_arm64.deb
PackageVersionOSORGSIZEFile URL
pg_fkpart_151.7.0el8.x86_64pgdg24.1 KiBpg_fkpart_15-1.7.0-3.rhel8.noarch.rpm
pg_fkpart_151.7.0el8.x86_64pigsty23.1 KiBpg_fkpart_15-1.7.0-1PIGSTY.el8.x86_64.rpm
pg_fkpart_151.7.0el8.aarch64pgdg24.0 KiBpg_fkpart_15-1.7.0-3.rhel8.noarch.rpm
pg_fkpart_151.7.0el8.aarch64pigsty23.1 KiBpg_fkpart_15-1.7.0-1PIGSTY.el8.aarch64.rpm
pg_fkpart_151.7.0el9.x86_64pgdg23.1 KiBpg_fkpart_15-1.7.0-3.rhel9.noarch.rpm
pg_fkpart_151.7.0el9.x86_64pigsty22.6 KiBpg_fkpart_15-1.7.0-1PIGSTY.el9.x86_64.rpm
pg_fkpart_151.7.0el9.aarch64pgdg22.9 KiBpg_fkpart_15-1.7.0-3.rhel9.noarch.rpm
pg_fkpart_151.7.0el9.aarch64pigsty22.6 KiBpg_fkpart_15-1.7.0-1PIGSTY.el9.aarch64.rpm
pg_fkpart_151.7.0el10.x86_64pgdg23.4 KiBpg_fkpart_15-1.7.0-6PGDG.rhel10.noarch.rpm
pg_fkpart_151.7.0el10.aarch64pgdg23.3 KiBpg_fkpart_15-1.7.0-6PGDG.rhel10.noarch.rpm
postgresql-15-pg-fkpart1.7.0d12.x86_64pigsty15.4 KiBpostgresql-15-pg-fkpart_1.7.0-1PIGSTY~bookworm_amd64.deb
postgresql-15-pg-fkpart1.7.0d12.aarch64pigsty15.4 KiBpostgresql-15-pg-fkpart_1.7.0-1PIGSTY~bookworm_arm64.deb
postgresql-15-pg-fkpart1.7.0d13.x86_64pigsty15.4 KiBpostgresql-15-pg-fkpart_1.7.0-1PIGSTY~trixie_amd64.deb
postgresql-15-pg-fkpart1.7.0d13.aarch64pigsty15.4 KiBpostgresql-15-pg-fkpart_1.7.0-1PIGSTY~trixie_arm64.deb
postgresql-15-pg-fkpart1.7.0u22.x86_64pigsty15.7 KiBpostgresql-15-pg-fkpart_1.7.0-1PIGSTY~jammy_amd64.deb
postgresql-15-pg-fkpart1.7.0u22.aarch64pigsty15.7 KiBpostgresql-15-pg-fkpart_1.7.0-1PIGSTY~jammy_arm64.deb
postgresql-15-pg-fkpart1.7.0u24.x86_64pigsty15.6 KiBpostgresql-15-pg-fkpart_1.7.0-1PIGSTY~noble_amd64.deb
postgresql-15-pg-fkpart1.7.0u24.aarch64pigsty15.6 KiBpostgresql-15-pg-fkpart_1.7.0-1PIGSTY~noble_arm64.deb
PackageVersionOSORGSIZEFile URL
pg_fkpart_141.7.0el8.x86_64pgdg24.1 KiBpg_fkpart_14-1.7.0-3.rhel8.noarch.rpm
pg_fkpart_141.7.0el8.x86_64pigsty23.1 KiBpg_fkpart_14-1.7.0-1PIGSTY.el8.x86_64.rpm
pg_fkpart_141.7.0el8.aarch64pgdg24.0 KiBpg_fkpart_14-1.7.0-3.rhel8.noarch.rpm
pg_fkpart_141.7.0el8.aarch64pigsty23.1 KiBpg_fkpart_14-1.7.0-1PIGSTY.el8.aarch64.rpm
pg_fkpart_141.7.0el9.x86_64pgdg23.1 KiBpg_fkpart_14-1.7.0-3.rhel9.noarch.rpm
pg_fkpart_141.7.0el9.x86_64pigsty22.6 KiBpg_fkpart_14-1.7.0-1PIGSTY.el9.x86_64.rpm
pg_fkpart_141.7.0el9.aarch64pgdg22.9 KiBpg_fkpart_14-1.7.0-3.rhel9.noarch.rpm
pg_fkpart_141.7.0el9.aarch64pigsty22.6 KiBpg_fkpart_14-1.7.0-1PIGSTY.el9.aarch64.rpm
pg_fkpart_141.7.0el10.x86_64pgdg23.4 KiBpg_fkpart_14-1.7.0-6PGDG.rhel10.noarch.rpm
pg_fkpart_141.7.0el10.aarch64pgdg23.3 KiBpg_fkpart_14-1.7.0-6PGDG.rhel10.noarch.rpm
postgresql-14-pg-fkpart1.7.0d12.x86_64pigsty15.4 KiBpostgresql-14-pg-fkpart_1.7.0-1PIGSTY~bookworm_amd64.deb
postgresql-14-pg-fkpart1.7.0d12.aarch64pigsty15.4 KiBpostgresql-14-pg-fkpart_1.7.0-1PIGSTY~bookworm_arm64.deb
postgresql-14-pg-fkpart1.7.0d13.x86_64pigsty15.4 KiBpostgresql-14-pg-fkpart_1.7.0-1PIGSTY~trixie_amd64.deb
postgresql-14-pg-fkpart1.7.0d13.aarch64pigsty15.4 KiBpostgresql-14-pg-fkpart_1.7.0-1PIGSTY~trixie_arm64.deb
postgresql-14-pg-fkpart1.7.0u22.x86_64pigsty15.7 KiBpostgresql-14-pg-fkpart_1.7.0-1PIGSTY~jammy_amd64.deb
postgresql-14-pg-fkpart1.7.0u22.aarch64pigsty15.7 KiBpostgresql-14-pg-fkpart_1.7.0-1PIGSTY~jammy_arm64.deb
postgresql-14-pg-fkpart1.7.0u24.x86_64pigsty15.6 KiBpostgresql-14-pg-fkpart_1.7.0-1PIGSTY~noble_amd64.deb
postgresql-14-pg-fkpart1.7.0u24.aarch64pigsty15.6 KiBpostgresql-14-pg-fkpart_1.7.0-1PIGSTY~noble_arm64.deb

Source

pig build pkg pg_fkpart;		# build deb

Install

Make sure PGDG and PIGSTY repo available:

pig repo add pgsql -u   # add both repo and update cache

Install this extension with pig:

pig install pg_fkpart;		# install via package name, for the active PG version

pig install pg_fkpart -v 18;   # install for PG 18
pig install pg_fkpart -v 17;   # install for PG 17
pig install pg_fkpart -v 16;   # install for PG 16
pig install pg_fkpart -v 15;   # install for PG 15
pig install pg_fkpart -v 14;   # install for PG 14

Create this extension with:

CREATE EXTENSION pg_fkpart;

Usage

pg_fkpart: Table partitioning by foreign key utility

pg_fkpart enables partitioning PostgreSQL tables based on a foreign key relationship. All functions reside in the pgfkpart schema.

Create the Extension

CREATE EXTENSION pg_fkpart;

Partition a Table by Foreign Key

SELECT pgfkpart.partition_with_fk(
    'public',           -- schema of the table to partition
    'my_table',         -- table to partition
    'public',           -- schema of the foreign key table
    'fk_table',         -- foreign key table
    true                -- support SQL RETURNING
);

Unpartition a Table

SELECT pgfkpart.unpartition_with_fk('public', 'my_table');

Index Management

Propagate indexes and constraints from parent to all child tables:

SELECT pgfkpart.dispatch_index('public', 'my_table');

Drop an index across all child tables:

SELECT pgfkpart.drop_index('public', 'my_table', 'my_index_name');

Drop a unique constraint across all child tables:

SELECT pgfkpart.drop_unique_constraint('public', 'my_table', 'my_constraint_name');

Partition Tracking

The extension maintains a pgfkpart.partition table that records all partitioned tables, including schema, table name, foreign key column, and foreign table information.

Last updated on