Re: Table Partitioning

Поиск
Список
Период
Сортировка
От Graham Everton
Тема Re: Table Partitioning
Дата
Msg-id DBAP191MB119391D291282C47F3260CBADBA30@DBAP191MB1193.EURP191.PROD.OUTLOOK.COM
обсуждение исходный текст
Ответ на Re: Table Partitioning  (Keith Fiske <keith.fiske@crunchydata.com>)
Список pgsql-admin
Op 0


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> 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

В списке pgsql-admin по дате отправления:

Предыдущее
От: Keith Fiske
Дата:
Сообщение: Re: Table Partitioning
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: hot standby in Postgresql 12