Re: Trigger to create automated range partition table - Mailing list pgsql-admin

From Keith
Subject Re: Trigger to create automated range partition table
Date
Msg-id CAHw75vvsSCGxWSZMj0cBN-brVVwDZ-N1kvnZ7Bx=F-jpMNbP4g@mail.gmail.com
Whole thread Raw
In response to Trigger to create automated range partition table  (bhanu prabhakar <bhanu1208@gmail.com>)
Responses Re: Trigger to create automated range partition table  (legrand legrand <legrand_legrand@hotmail.com>)
List pgsql-admin


On Tue, Nov 20, 2018 at 10:42 PM bhanu prabhakar <bhanu1208@gmail.com> wrote:
Hi friends,

As a part of migration from Oracle to AWS Aurora postgress. I have converted the partition table using ora2pg tool. 

In Oracle we have feature of automated partition table creation when we insert the data, but in postgress 10.4 that feature is not enabled. 

Kindly help me and give some rough idea or example to create  a trigger on table to create automated partition table when we insert the data.Thank you 

Bhanu P Murari.

It is not recommended that table creation for partitions be done via triggers at this time unless the write level on the table is very, very low. Since DDL is transactional in PostgreSQL, this can cause contention on very active tables when that new child table is created.

I maintain an extension called pg_partman that can help with the automatic pre-creation of child tables before they are needed for time & serial/id based partition sets.


Keith

pgsql-admin by date:

Previous
From: Achilleas Mantzios
Date:
Subject: Re: PostgreSQL 10.5 : Logical replication timeout results in PANIC inpg_wal "No space left on device"
Next
From: legrand legrand
Date:
Subject: Re: Trigger to create automated range partition table