pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: John Scalia <jayknowsunix@gmail.com>
To: rammohan ganapavarapu <rammohanganap@gmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Partitions
Date: Thu, 9 Nov 2017 18:41:25 -0500
Message-ID: <D0905E2B-C734-498C-B138-77910CF6C33A@gmail.com> (raw)
In-Reply-To: <CALm_VjhFWgFcZkxZEE=8bGSxidfRf=UgAzXfkW4H62XPwhNikw@mail.gmail.com>
References: <CALm_VjhFWgFcZkxZEE=8bGSxidfRf=UgAzXfkW4H62XPwhNikw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>

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.
—
Jay

Sent from my iPad

> On Nov 9, 2017, at 6:28 PM, rammohan ganapavarapu <rammohanganap@gmail.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@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



view thread (8+ messages)  latest in thread

Message-ID: <D0905E2B-C734-498C-B138-77910CF6C33A@gmail.com>
Permalink:  ../D0905E2B-C734-498C-B138-77910CF6C33A@gmail.com/
Also on:    postgresql.org/message-id/D0905E2B-C734-498C-B138-77910CF6C33A@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: jayknowsunix@gmail.com, rammohanganap@gmail.com
  Subject: Re: Partitions
  In-Reply-To: <D0905E2B-C734-498C-B138-77910CF6C33A@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox