pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: legrand legrand <legrand_legrand@hotmail.com>
To: pgsql-admin@postgresql.org
Subject: Re: Trigger to create automated range partition table
Date: Wed, 21 Nov 2018 01:09:57 -0700 (MST)
Message-ID: <1542787797239-0.post@n3.nabble.com> (raw)
In-Reply-To: <CAHw75vvsSCGxWSZMj0cBN-brVVwDZ-N1kvnZ7Bx=F-jpMNbP4g@mail.gmail.com>
References: <CACBZq4xNCVEsCSnV_vhOQULtcwUnHpji+=eyw2sE2=_2V2n3Mg@mail.gmail.com>
	<CAHw75vvsSCGxWSZMj0cBN-brVVwDZ-N1kvnZ7Bx=F-jpMNbP4g@mail.gmail.com>

I confirm: This is not working now

for pg10 see
https://www.postgresql-archive.org/BUG-15437-Segfault-during-insert-into-declarative-partitioned-tab...

this kind of trigger is even not supported in pg11
postgres=# CREATE TRIGGER check_pkey BEFORE INSERT ON tabpart
postgres-#      FOR EACH ROW EXECUTE PROCEDURE public.f_check_pkey();
ERROR:  "tabpart" is a partitioned table
DETAIL:  Partitioned tables cannot have BEFORE / FOR EACH ROW triggers.

There are many development works regarding this
see all threads about ATTACH/DETACH PARTITION CONCURRENTLY
for example

Today the only solution is to create those partitions before the first
INSERT statement ;o(

Regards
PAscal



--
Sent from: http://www.postgresql-archive.org/PostgreSQL-admin-f2076596.html




view thread (3+ messages)

Message-ID: <1542787797239-0.post@n3.nabble.com>
Permalink:  ../1542787797239-0.post@n3.nabble.com/
Also on:    postgresql.org/message-id/1542787797239-0.post@n3.nabble.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: legrand_legrand@hotmail.com
  Subject: Re: Trigger to create automated range partition table
  In-Reply-To: <1542787797239-0.post@n3.nabble.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