
{"id":8626,"date":"2025-06-18T09:18:38","date_gmt":"2025-06-18T09:18:38","guid":{"rendered":"https:\/\/test.opensource-db.in\/wp1\/?p=8626"},"modified":"2025-06-18T09:18:41","modified_gmt":"2025-06-18T09:18:41","slug":"effortless-postgresql-partitioning-with-pg_partman","status":"publish","type":"post","link":"https:\/\/test.opensource-db.in\/wp1\/effortless-postgresql-partitioning-with-pg_partman\/","title":{"rendered":"Effortless PostgreSQL Partitioning with pg_partman"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Managing large datasets in PostgreSQL can quickly become a challenge, especially as tables grow and query performance starts to degrade. Partitioning is a proven approach to tackle this, but native PostgreSQL partitioning can be complex and time-consuming to set up and maintain. Here comes&nbsp;<strong>pg_partman<\/strong>, a robust extension that automates and simplifies partition management, making it accessible to everyone from database novices to seasoned DBAs.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>What is pg_partman?<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>pg_partman<\/strong>&nbsp;(PostgreSQL Partition Manager) is an open-source extension designed to automate the creation and maintenance of partitioned tables in PostgreSQL. It supports both time-based and serial-based (number-based) partitioning, and is actively maintained by the PostgreSQL community.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">With pg_partman, we can:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Automatically create new partitions as data grows.<\/li>\n\n\n\n<li>Drop old partitions based on retention policies.<\/li>\n\n\n\n<li>Seamlessly manage both new and existing tables.<\/li>\n\n\n\n<li>Eliminate the need for external schedulers (like cron) through its built-in background worker process<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Installation<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">pg_partman is available on github. The prerequisities are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>postgresql-devel<\/code> package<\/li>\n\n\n\n<li><code>gcc<\/code>, <code>make<\/code>, and Git<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Once we have prerequisties , execute the following commands with root or user with sudo privileges<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># 1. Navigate to a temporary directory\ncd \/tmp\n\n# 2. Clone the pg_partman GitHub repository\ngit clone https:\/\/github.com\/pgpartman\/pg_partman.git\ncd pg_partman\n\n# 3. Ensure PostgreSQL 16 binaries are in your PATH\nexport PATH=\/usr\/pgsql-16\/bin:$PATH\n\n# 4.1 Build and install the extension\nmake install\n\n# 4.2 If we want to build and install the extension without background worker\nmake NO_BGW=1 install<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Once the installation is done, connect to the database and enable extension<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE SCHEMA partman;\nCREATE EXTENSION pg_partman SCHEMA partman;\npostgres=# \\dx\n                               List of installed extensions\n    Name    | Version |   Schema   |                     Description\n------------+---------+------------+------------------------------------------------------\n pg_partman | 5.2.4   | partman    | Extension to manage partitioned tables by time or ID\n plpgsql    | 1.0     | pg_catalog | PL\/pgSQL procedural language\n(2 rows)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"key-differences-between-time-based-and-serial-base\">Time-Based and Serial-Based Partitioning in pg_partman<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">pg_partman supports two primary types of range partitioning:&nbsp;<strong>time-based<\/strong>&nbsp;and&nbsp;<strong>serial-based<\/strong>. Both approaches help manage large tables by dividing them into smaller, more manageable partitions, but they differ in their partitioning keys, use cases, and configuration.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Feature<\/th><th>Time-Based Partitioning<\/th><th>Serial-Based Partitioning<\/th><\/tr><\/thead><tbody><tr><td><strong>Partition Key<\/strong><\/td><td>Date or timestamp column<\/td><td>Integer or serial (ID) column<\/td><\/tr><tr><td><strong>Partition Interval<\/strong><\/td><td>Time intervals (e.g., day, month)<\/td><td>Numeric intervals (e.g., every 100,000)<\/td><\/tr><tr><td><strong>Use Cases<\/strong><\/td><td>Time-series data, logs, IoT, events<\/td><td>Sequential IDs, batch imports, archiving<\/td><\/tr><tr><td><strong>Partition Naming<\/strong><\/td><td>Based on date\/time (e.g., 20240601)<\/td><td>Based on ID range (e.g., 100000-200000)<\/td><\/tr><tr><td><strong>Configuration<\/strong><\/td><td><code>p_interval<\/code>&nbsp;set to time unit<\/td><td><code>p_interval<\/code>&nbsp;set to numeric value<\/td><\/tr><tr><td><strong>Typical Examples<\/strong><\/td><td>Partition by day, week, month, year<\/td><td>Partition by every N IDs<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s create a table and partition them using <code>pg_partman<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Time-based partition<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#Create a table and partition using timestamp\npostgres=# CREATE TABLE public.time_events (\n    event_id BIGSERIAL,\n    event_time TIMESTAMPTZ NOT NULL,\n    event_type TEXT,\n    details JSONB,\n    PRIMARY KEY (event_id, event_time)\n) PARTITION BY RANGE (event_time);\nCREATE TABLE\npostgres=# SELECT partman.create_parent(\n    p_parent_table := 'public.time_events',\n    p_control := 'event_time',\n    p_interval := '1 day'\n);\n create_parent\n---------------\n t\n(1 row)\n\npostgres=# \\d+ public.time_events\n                                                               Partitioned table \"public.time_events\"\n   Column   |           Type           | Collation | Nullable |                    Default                    | Storage  | Compression | Stats target | Description\n------------+--------------------------+-----------+----------+-----------------------------------------------+----------+-------------+--------------+-------------\n event_id   | bigint                   |           | not null | nextval('time_events_event_id_seq'::regclass) | plain    |             |              |\n event_time | timestamp with time zone |           | not null |                                               | plain    |             |              |\n event_type | text                     |           |          |                                               | extended |             |              |\n details    | jsonb                    |           |          |                                               | extended |             |              |\nPartition key: RANGE (event_time)\nIndexes:\n    \"time_events_pkey\" PRIMARY KEY, btree (event_id, event_time)\nPartitions: time_events_p20250613 FOR VALUES FROM ('2025-06-13 00:00:00+05:30') TO ('2025-06-14 00:00:00+05:30'),\n            time_events_p20250614 FOR VALUES FROM ('2025-06-14 00:00:00+05:30') TO ('2025-06-15 00:00:00+05:30'),\n            time_events_p20250615 FOR VALUES FROM ('2025-06-15 00:00:00+05:30') TO ('2025-06-16 00:00:00+05:30'),\n            time_events_p20250616 FOR VALUES FROM ('2025-06-16 00:00:00+05:30') TO ('2025-06-17 00:00:00+05:30'),\n            time_events_p20250617 FOR VALUES FROM ('2025-06-17 00:00:00+05:30') TO ('2025-06-18 00:00:00+05:30'),\n            time_events_p20250618 FOR VALUES FROM ('2025-06-18 00:00:00+05:30') TO ('2025-06-19 00:00:00+05:30'),\n            time_events_p20250619 FOR VALUES FROM ('2025-06-19 00:00:00+05:30') TO ('2025-06-20 00:00:00+05:30'),\n            time_events_p20250620 FOR VALUES FROM ('2025-06-20 00:00:00+05:30') TO ('2025-06-21 00:00:00+05:30'),\n            time_events_p20250621 FOR VALUES FROM ('2025-06-21 00:00:00+05:30') TO ('2025-06-22 00:00:00+05:30'),\n            time_events_default DEFAULT<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Series-based partition<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#Create a table and partition using serial \npostgres=# CREATE TABLE public.serial_items (\n    item_id BIGSERIAL PRIMARY KEY,\n    item_name TEXT,\n    created_at TIMESTAMPTZ DEFAULT now()\n) PARTITION BY RANGE (item_id);\nCREATE TABLE\npostgres=# SELECT partman.create_parent(\n    p_parent_table := 'public.serial_items',\n    p_control := 'item_id',\n    p_interval := '1000'\n);\n-&#91; RECORD 1 ]-+--\ncreate_parent | t\npostgres=# \\d+ serial_items\n                                                              Partitioned table \"public.serial_items\"\n   Column   |           Type           | Collation | Nullable |                    Default                    | Storage  | Compression | Stats target | Description\n------------+--------------------------+-----------+----------+-----------------------------------------------+----------+-------------+--------------+-------------\n item_id    | bigint                   |           | not null | nextval('serial_items_item_id_seq'::regclass) | plain    |             |              |\n item_name  | text                     |           |          |                                               | extended |             |              |\n created_at | timestamp with time zone |           |          | now()                                         | plain    |             |              |\nPartition key: RANGE (item_id)\nIndexes:\n    \"serial_items_pkey\" PRIMARY KEY, btree (item_id)\nPartitions: serial_items_p0 FOR VALUES FROM ('0') TO ('1000'),\n            serial_items_p1000 FOR VALUES FROM ('1000') TO ('2000'),\n            serial_items_p2000 FOR VALUES FROM ('2000') TO ('3000'),\n            serial_items_p3000 FOR VALUES FROM ('3000') TO ('4000'),\n            serial_items_p4000 FOR VALUES FROM ('4000') TO ('5000'),\n            serial_items_default DEFAULT<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>pg_partman<\/code> maintains a configuration table <code>partman.part_config<\/code>. After setting up the partitions, querying this table shows details about each partitioned parent:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> postgres=# select * from partman.part_config;\n-&#91; RECORD 1 ]--------------+-------------------------------------\nparent_table               | public.time_events\ncontrol                    | event_time\ntime_encoder               |\ntime_decoder               |\npartition_interval         | 1 day\npartition_type             | range\npremake                    | 4\nautomatic_maintenance      | on\ntemplate_table             | partman.template_public_time_events\nretention                  |\nretention_schema           |\nretention_keep_index       | t\nretention_keep_table       | t\nepoch                      | none\nconstraint_cols            |\noptimize_constraint        | 30\ninfinite_time_partitions   | f\ndatetime_string            | YYYYMMDD\njobmon                     | t\nsub_partition_set_full     | f\nundo_in_progress           | f\ninherit_privileges         | f\nconstraint_valid           | t\nignore_default_data        | t\ndate_trunc_interval        |\nmaintenance_order          |\nretention_keep_publication | f\nmaintenance_last_run       |F\n-&#91; RECORD 2 ]--------------+-------------------------------------\nparent_table               | public.serial_items\ncontrol                    | item_id\ntime_encoder               |\ntime_decoder               |\npartition_interval         | 1000\npartition_type             | range\npremake                    | 4\nautomatic_maintenance      | on\ntemplate_table             | partman.template_public_serial_items\nretention                  |\nretention_schema           |\nretention_keep_index       | t\nretention_keep_table       | t\nepoch                      | none\nconstraint_cols            |\noptimize_constraint        | 30\ninfinite_time_partitions   | f\ndatetime_string            |\njobmon                     | t\nsub_partition_set_full     | f\nundo_in_progress           | f\ninherit_privileges         | f\nconstraint_valid           | t\nignore_default_data        | t\ndate_trunc_interval        |\nmaintenance_order          |\nretention_keep_publication | f\nmaintenance_last_run       |<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Understanding key columns of <code>partman.part_config<\/code><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>parent_table<\/code>: name of the parent (e.g., <code>public.time_events<\/code>, <code>public.serial_items<\/code>)<\/li>\n\n\n\n<li><code>control<\/code>: column used for partitioning (<code>event_time<\/code> or <code>item_id<\/code>)<\/li>\n\n\n\n<li><code>partition_interval<\/code>: daily for time, or 1000 for series<\/li>\n\n\n\n<li><code>template_table<\/code>: auto-generated internal template used to create each new child partition<\/li>\n\n\n\n<li><code>automatic_maintenance<\/code>: whether pg_partman should auto-maintain partitions<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">We can also configure retention and infinite partitioning for the parent table managed by <code>pg_partman<\/code> by updating the <code>partman.part_config<\/code>. It enables <code>infinite_time_partitions<\/code>, allowing partitions to extend indefinitely into the future, and sets up automatic retention by specifying a retention period. Expired partitions will be moved to the specified schema instead of being dropped, with both table structures and indexes preserved by setting <code>retention_keep_table<\/code> and <code>retention_keep_index<\/code> to <code>true<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Most frequenctly used procedures of <code>pg_partman<\/code><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here are some of the frequently used procedures of <code>pg_partman<\/code><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Function Name<\/th><th>Purpose<\/th><\/tr><\/thead><tbody><tr><td><code>create_parent<\/code><\/td><td>Register an existing table as a partition parent and configure partitioning<\/td><\/tr><tr><td><code>undo_partition<\/code><\/td><td>Remove partitioning from a table and optionally merge data back to the parent<\/td><\/tr><tr><td><code>run_maintenance<\/code><\/td><td>Manually trigger partition maintenance (create new partitions, drop old ones, etc.)<\/td><\/tr><tr><td><code>show_partitions<\/code><\/td><td>List all child partitions for a given parent table<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><code>pg_partman<\/code> supports automatic partition maintenance to proactively create future partitions and avoid data falling into the default partition. This can be achieved using the <code>run_maintenance()<\/code> function, either through a <strong>background worker<\/strong> or a <strong>cron scheduler<\/strong>. To enable the background worker, the <code>shared_preload_libraries<\/code> must include <code>'pg_partman_bgw'<\/code>, which requires a PostgreSQL restart. Once enabled, configuration parameters such as <code>pg_partman_bgw.interval<\/code>, <code>dbname<\/code>, <code>role<\/code>, and <code>analyze<\/code> allow fine control over how and when partition maintenance runs. Alternatively, a cron job like <code>00 01,12 * * * psql -c \"SELECT pg_partman.run_maintenance()\"<\/code> can be scheduled to run the maintenance function periodically. The key advantages of <code>pg_partman<\/code> include automated data retention policies (archive or drop partitions), improved query performance by narrowing scans to relevant partitions, better vacuum efficiency due to smaller partition sizes, and the ability to attach or detach partitions concurrently without service disruption.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before we conclude, here are some blogs that explore manual approaches to partitioning and archiving : <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/test.opensource-db.in\/wp1\/postgresql-partitioning-made-easy-features-benefits-and-tips\/\">PostgreSQL Partitioning Made Easy: Features, Benefits, and Tips<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/test.opensource-db.in\/wp1\/efficient-data-management-overcoming-the-challenges-of-large-tables-with-an-archival-strategy\/\">Efficient Data Management: Overcoming the Challenges of Large Tables with an Archival Strategy<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Managing large-scale datasets in PostgreSQL becomes significantly more efficient with <strong>pg_partman<\/strong>, a powerful and flexible extension that simplifies and automates table partitioning. By supporting both time-based and serial-based partitioning, pg_partman caters to a wide range of use cases\u2014from time-series logs to bulk data imports. It not only automates partition creation and retention but also provides tools like <code>run_maintenance()<\/code>, background workers, and cron integration to maintain optimal performance without manual intervention. With easy setup, customizable configurations, and powerful features like infinite partitions and non-destructive retention, pg_partman greatly reduces administrative overhead while improving query performance, vacuum efficiency, and operational flexibility. Whether you&#8217;re a PostgreSQL beginner or a seasoned DBA, pg_partman is an essential tool for scaling your data infrastructure with confidence.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Managing large datasets in PostgreSQL can quickly become a challenge, especially as tables grow and query performance starts to degrade. [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":8634,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1,23,42,89],"tags":[34,24,44,26],"class_list":["post-8626","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-others","category-postgresql-14","category-postgresql-15","category-postgresql-16","tag-dba","tag-postgres14","tag-postgres15","tag-postgresql"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Effortless PostgreSQL Partitioning with pg_partman - OpenSource DB<\/title>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Effortless PostgreSQL Partitioning with pg_partman - OpenSource DB\" \/>\n<meta property=\"og:description\" content=\"Managing large datasets in PostgreSQL can quickly become a challenge, especially as tables grow and query performance starts to degrade. [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/test.opensource-db.in\/wp1\/effortless-postgresql-partitioning-with-pg_partman\/\" \/>\n<meta property=\"og:site_name\" content=\"OpenSource DB\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/people\/OpenSource-DB\/100072970755470\/\" \/>\n<meta property=\"article:published_time\" content=\"2025-06-18T09:18:38+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-18T09:18:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/06\/image-22.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1800\" \/>\n\t<meta property=\"og:image:height\" content=\"945\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Venkat Akhil\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@opensource_db\" \/>\n<meta name=\"twitter:site\" content=\"@opensource_db\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Venkat Akhil\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/effortless-postgresql-partitioning-with-pg_partman\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/effortless-postgresql-partitioning-with-pg_partman\/\"},\"author\":{\"name\":\"Venkat Akhil\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/person\/a37b142ecbf953189a4f9209b0b8d328\"},\"headline\":\"Effortless PostgreSQL Partitioning with pg_partman\",\"datePublished\":\"2025-06-18T09:18:38+00:00\",\"dateModified\":\"2025-06-18T09:18:41+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/effortless-postgresql-partitioning-with-pg_partman\/\"},\"wordCount\":792,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#organization\"},\"image\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/effortless-postgresql-partitioning-with-pg_partman\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/06\/image-22.png\",\"keywords\":[\"dba\",\"postgres14\",\"postgres15\",\"postgresql\"],\"articleSection\":[\"Others\",\"PostgreSQL 14\",\"PostgreSQL 15\",\"PostgreSQL 16\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/test.opensource-db.in\/wp1\/effortless-postgresql-partitioning-with-pg_partman\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/effortless-postgresql-partitioning-with-pg_partman\/\",\"url\":\"https:\/\/test.opensource-db.in\/wp1\/effortless-postgresql-partitioning-with-pg_partman\/\",\"name\":\"Effortless PostgreSQL Partitioning with pg_partman - OpenSource DB\",\"isPartOf\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/effortless-postgresql-partitioning-with-pg_partman\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/effortless-postgresql-partitioning-with-pg_partman\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/06\/image-22.png\",\"datePublished\":\"2025-06-18T09:18:38+00:00\",\"dateModified\":\"2025-06-18T09:18:41+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/effortless-postgresql-partitioning-with-pg_partman\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/test.opensource-db.in\/wp1\/effortless-postgresql-partitioning-with-pg_partman\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/effortless-postgresql-partitioning-with-pg_partman\/#primaryimage\",\"url\":\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/06\/image-22.png\",\"contentUrl\":\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/06\/image-22.png\",\"width\":1800,\"height\":945},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/effortless-postgresql-partitioning-with-pg_partman\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/test.opensource-db.in\/wp1\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Effortless PostgreSQL Partitioning with pg_partman\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#website\",\"url\":\"https:\/\/test.opensource-db.in\/wp1\/\",\"name\":\"OpenSource DB\",\"description\":\"Your Trusted OpenSource Databases partner\",\"publisher\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/test.opensource-db.in\/wp1\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#organization\",\"name\":\"OPENSOURCE DB PRIVATE LIMITED\",\"url\":\"https:\/\/test.opensource-db.in\/wp1\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2021\/10\/osdb-logo-tm-2.png\",\"contentUrl\":\"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2021\/10\/osdb-logo-tm-2.png\",\"width\":368,\"height\":120,\"caption\":\"OPENSOURCE DB PRIVATE LIMITED\"},\"image\":{\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/people\/OpenSource-DB\/100072970755470\/\",\"https:\/\/x.com\/opensource_db\",\"https:\/\/www.youtube.com\/channel\/UCmTI5h\",\"https:\/\/www.linkedin.com\/company\/opensource-db\",\"https:\/\/www.instagram.com\/opensource_db\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/person\/a37b142ecbf953189a4f9209b0b8d328\",\"name\":\"Venkat Akhil\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/522c0947d21b2c2c89f10698fd9131f9db4110f65c8d02b53d9b4559c7650865?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/522c0947d21b2c2c89f10698fd9131f9db4110f65c8d02b53d9b4559c7650865?s=96&d=mm&r=g\",\"caption\":\"Venkat Akhil\"},\"url\":\"https:\/\/test.opensource-db.in\/wp1\/author\/sudheer-sopensource-db-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Effortless PostgreSQL Partitioning with pg_partman - OpenSource DB","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_US","og_type":"article","og_title":"Effortless PostgreSQL Partitioning with pg_partman - OpenSource DB","og_description":"Managing large datasets in PostgreSQL can quickly become a challenge, especially as tables grow and query performance starts to degrade. [&hellip;]","og_url":"https:\/\/test.opensource-db.in\/wp1\/effortless-postgresql-partitioning-with-pg_partman\/","og_site_name":"OpenSource DB","article_publisher":"https:\/\/www.facebook.com\/people\/OpenSource-DB\/100072970755470\/","article_published_time":"2025-06-18T09:18:38+00:00","article_modified_time":"2025-06-18T09:18:41+00:00","og_image":[{"width":1800,"height":945,"url":"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/06\/image-22.png","type":"image\/png"}],"author":"Venkat Akhil","twitter_card":"summary_large_image","twitter_creator":"@opensource_db","twitter_site":"@opensource_db","twitter_misc":{"Written by":"Venkat Akhil","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/test.opensource-db.in\/wp1\/effortless-postgresql-partitioning-with-pg_partman\/#article","isPartOf":{"@id":"https:\/\/test.opensource-db.in\/wp1\/effortless-postgresql-partitioning-with-pg_partman\/"},"author":{"name":"Venkat Akhil","@id":"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/person\/a37b142ecbf953189a4f9209b0b8d328"},"headline":"Effortless PostgreSQL Partitioning with pg_partman","datePublished":"2025-06-18T09:18:38+00:00","dateModified":"2025-06-18T09:18:41+00:00","mainEntityOfPage":{"@id":"https:\/\/test.opensource-db.in\/wp1\/effortless-postgresql-partitioning-with-pg_partman\/"},"wordCount":792,"commentCount":0,"publisher":{"@id":"https:\/\/test.opensource-db.in\/wp1\/#organization"},"image":{"@id":"https:\/\/test.opensource-db.in\/wp1\/effortless-postgresql-partitioning-with-pg_partman\/#primaryimage"},"thumbnailUrl":"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/06\/image-22.png","keywords":["dba","postgres14","postgres15","postgresql"],"articleSection":["Others","PostgreSQL 14","PostgreSQL 15","PostgreSQL 16"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/test.opensource-db.in\/wp1\/effortless-postgresql-partitioning-with-pg_partman\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/test.opensource-db.in\/wp1\/effortless-postgresql-partitioning-with-pg_partman\/","url":"https:\/\/test.opensource-db.in\/wp1\/effortless-postgresql-partitioning-with-pg_partman\/","name":"Effortless PostgreSQL Partitioning with pg_partman - OpenSource DB","isPartOf":{"@id":"https:\/\/test.opensource-db.in\/wp1\/#website"},"primaryImageOfPage":{"@id":"https:\/\/test.opensource-db.in\/wp1\/effortless-postgresql-partitioning-with-pg_partman\/#primaryimage"},"image":{"@id":"https:\/\/test.opensource-db.in\/wp1\/effortless-postgresql-partitioning-with-pg_partman\/#primaryimage"},"thumbnailUrl":"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/06\/image-22.png","datePublished":"2025-06-18T09:18:38+00:00","dateModified":"2025-06-18T09:18:41+00:00","breadcrumb":{"@id":"https:\/\/test.opensource-db.in\/wp1\/effortless-postgresql-partitioning-with-pg_partman\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/test.opensource-db.in\/wp1\/effortless-postgresql-partitioning-with-pg_partman\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/test.opensource-db.in\/wp1\/effortless-postgresql-partitioning-with-pg_partman\/#primaryimage","url":"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/06\/image-22.png","contentUrl":"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/06\/image-22.png","width":1800,"height":945},{"@type":"BreadcrumbList","@id":"https:\/\/test.opensource-db.in\/wp1\/effortless-postgresql-partitioning-with-pg_partman\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/test.opensource-db.in\/wp1\/"},{"@type":"ListItem","position":2,"name":"Effortless PostgreSQL Partitioning with pg_partman"}]},{"@type":"WebSite","@id":"https:\/\/test.opensource-db.in\/wp1\/#website","url":"https:\/\/test.opensource-db.in\/wp1\/","name":"OpenSource DB","description":"Your Trusted OpenSource Databases partner","publisher":{"@id":"https:\/\/test.opensource-db.in\/wp1\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/test.opensource-db.in\/wp1\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/test.opensource-db.in\/wp1\/#organization","name":"OPENSOURCE DB PRIVATE LIMITED","url":"https:\/\/test.opensource-db.in\/wp1\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/logo\/image\/","url":"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2021\/10\/osdb-logo-tm-2.png","contentUrl":"https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2021\/10\/osdb-logo-tm-2.png","width":368,"height":120,"caption":"OPENSOURCE DB PRIVATE LIMITED"},"image":{"@id":"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/people\/OpenSource-DB\/100072970755470\/","https:\/\/x.com\/opensource_db","https:\/\/www.youtube.com\/channel\/UCmTI5h","https:\/\/www.linkedin.com\/company\/opensource-db","https:\/\/www.instagram.com\/opensource_db\/"]},{"@type":"Person","@id":"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/person\/a37b142ecbf953189a4f9209b0b8d328","name":"Venkat Akhil","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/test.opensource-db.in\/wp1\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/522c0947d21b2c2c89f10698fd9131f9db4110f65c8d02b53d9b4559c7650865?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/522c0947d21b2c2c89f10698fd9131f9db4110f65c8d02b53d9b4559c7650865?s=96&d=mm&r=g","caption":"Venkat Akhil"},"url":"https:\/\/test.opensource-db.in\/wp1\/author\/sudheer-sopensource-db-com\/"}]}},"rttpg_featured_image_url":{"full":["https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/06\/image-22.png",1800,945,false],"landscape":["https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/06\/image-22.png",1800,945,false],"portraits":["https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/06\/image-22.png",1800,945,false],"thumbnail":["https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/06\/image-22-150x150.png",150,150,true],"medium":["https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/06\/image-22-300x158.png",300,158,true],"large":["https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/06\/image-22-1024x538.png",1024,538,true],"1536x1536":["https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/06\/image-22-1536x806.png",1536,806,true],"2048x2048":["https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/06\/image-22.png",1800,945,false],"ultp_layout_landscape_large":["https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/06\/image-22.png",1200,630,false],"ultp_layout_landscape":["https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/06\/image-22.png",870,457,false],"ultp_layout_portrait":["https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/06\/image-22.png",600,315,false],"ultp_layout_square":["https:\/\/test.opensource-db.in\/wp1\/wp-content\/uploads\/2025\/06\/image-22.png",600,315,false]},"rttpg_author":{"display_name":"Venkat Akhil","author_link":"https:\/\/test.opensource-db.in\/wp1\/author\/sudheer-sopensource-db-com\/"},"rttpg_comment":0,"rttpg_category":"<a href=\"https:\/\/test.opensource-db.in\/wp1\/category\/business\/others\/\" rel=\"category tag\">Others<\/a> <a href=\"https:\/\/test.opensource-db.in\/wp1\/category\/postgres\/postgresql-14\/\" rel=\"category tag\">PostgreSQL 14<\/a> <a href=\"https:\/\/test.opensource-db.in\/wp1\/category\/postgres\/postgresql-15\/\" rel=\"category tag\">PostgreSQL 15<\/a> <a href=\"https:\/\/test.opensource-db.in\/wp1\/category\/postgres\/postgresql-16\/\" rel=\"category tag\">PostgreSQL 16<\/a>","rttpg_excerpt":"Managing large datasets in PostgreSQL can quickly become a challenge, especially as tables grow and query performance starts to degrade. [&hellip;]","_links":{"self":[{"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/posts\/8626","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/comments?post=8626"}],"version-history":[{"count":4,"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/posts\/8626\/revisions"}],"predecessor-version":[{"id":8632,"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/posts\/8626\/revisions\/8632"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/media\/8634"}],"wp:attachment":[{"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/media?parent=8626"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/categories?post=8626"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/test.opensource-db.in\/wp1\/wp-json\/wp\/v2\/tags?post=8626"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}