From: | Scott Mead <scottm(at)openscg(dot)com> |
---|---|
To: | John Scalia <jayknowsunix(at)gmail(dot)com> |
Cc: | rammohan ganapavarapu <rammohanganap(at)gmail(dot)com>, pgsql-admin(at)postgresql(dot)org |
Subject: | Re: Partitions |
Date: | 2017-11-10 02:03:30 |
Message-ID: | 4B91E005-F3DB-499A-A20C-C68AEDF3320D@openscg.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
> On Nov 9, 2017, at 18:41, John Scalia <jayknowsunix(at)gmail(dot)com> wrote:
>
> Set up a trigger on insert to check for the existence of the partition table, then it could do the insert there or create the table if needed and insert. Look online. I know I’ve seen examples of this.
Be careful here, these solutions generally take a massive performance hit. The best method is the native pg_partman function. It includes a built-in scheduler so that you don’t need to rely on an external tool like cron.
> —
> Jay
>
> Sent from my iPad
>
>> On Nov 9, 2017, at 6:28 PM, rammohan ganapavarapu <rammohanganap(at)gmail(dot)com> wrote:
>>
>> Hi,
>>
>> I have a requirement to create monthly partitions in my db, i am trying to understand what is the best way to do it, i know i can run a cron job to check if partition exist and create if not at the starting of month. Any suggestions?
>>
>> Thanks,
>> Ram
>
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
From | Date | Subject | |
---|---|---|---|
Next Message | Gokhan Demir | 2017-11-10 15:01:44 | Re: PostgreSQL WAL file issue |
Previous Message | rammohan ganapavarapu | 2017-11-10 01:59:50 | Re: Partitions |