pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Graham Everton <e.man.33@outlook.com>
To: depesz@depesz.com <depesz@depesz.com>
To: Keith Fiske <keith.fiske@crunchydata.com>
Cc: Anjul Tyagi <anjul@ibosstech-us.com>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: Table Partitioning
Date: Tue, 19 Jan 2021 15:00:41 +0000
Message-ID: <DBAP191MB119391D291282C47F3260CBADBA30@DBAP191MB1193.EURP191.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <CAODZiv6HQSSMKFR-L4_GP8dRmOdp1mRC9WjG2nicUTE=u0z6=A@mail.gmail.com>
References: <em77ea4711-7a8c-4eae-a935-4136d303ea88@iboss01108>
	<20210119114246.GA13372@depesz.com>
	<em953b223e-5ce1-4b39-a943-f101af602baa@iboss01108>
	<20210119121204.GB13372@depesz.com>
	<CAODZiv6HQSSMKFR-L4_GP8dRmOdp1mRC9WjG2nicUTE=u0z6=A@mail.gmail.com>

Op 0

Get Outlook for Android<https://aka.ms/ghei36;

________________________________
From: Keith Fiske <keith.fiske@crunchydata.com>
Sent: Tuesday, January 19, 2021 1:32:34 PM
To: depesz@depesz.com <depesz@depesz.com>
Cc: Anjul Tyagi <anjul@ibosstech-us.com>; pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: Table Partitioning



On Tue, Jan 19, 2021 at 7:12 AM hubert depesz lubaczewski <depesz@depesz.com<mailto:depesz@depesz.com>> wrote:
On Tue, Jan 19, 2021 at 12:01:12PM +0000, Anjul Tyagi wrote:
> Can we handle that in DB side with trigger?

I don't think so. At least not easily.

You could make a function to do so, though.

Best regards,

depesz




As depesz said, a trigger is possible, but very tricky. I was never able to find a good trigger-based, solution to these kinds of updates for pg_partman myself. Thankfully support for updates that move data between child tables was added for native partitioning in PG11. I would highly suggest planning an upgrade to your major version of PG. Skip 11 and go right to 12 or 13. An upgrade would be arguably easier than trying to code this yourself. And the added features to native partitioning in 11 and above will make managing them far better in the long run.

--
Keith Fiske
Senior Database Engineer
Crunchy Data - http://crunchydata.com<https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fcrunchyd...;

view thread (14+ messages)  latest in thread

Message-ID: <DBAP191MB119391D291282C47F3260CBADBA30@DBAP191MB1193.EURP191.PROD.OUTLOOK.COM>
Permalink:  ../DBAP191MB119391D291282C47F3260CBADBA30@DBAP191MB1193.EURP191.PROD.OUTLOOK.COM/
Also on:    postgresql.org/message-id/DBAP191MB119391D291282C47F3260CBADBA30@DBAP191MB1193.EURP191.PROD.OUTLOOK.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: e.man.33@outlook.com, depesz@depesz.com, keith.fiske@crunchydata.com, anjul@ibosstech-us.com
  Subject: Re: Table Partitioning
  In-Reply-To: <DBAP191MB119391D291282C47F3260CBADBA30@DBAP191MB1193.EURP191.PROD.OUTLOOK.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