Re: BUG #15437: Segfault during insert into declarative partitioned table with a trigger creating partition - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #15437: Segfault during insert into declarative partitioned table with a trigger creating partition
Date
Msg-id 8213.1539917571@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #15437: Segfault during insert into declarative partitionedtable with a trigger creating partition  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Responses Re: BUG #15437: Segfault during insert into declarative partitionedtable with a trigger creating partition
List pgsql-bugs
Amit Langote <Langote_Amit_f8@lab.ntt.co.jp> writes:
> On 2018/10/18 20:57, PG Bug reporting form wrote:
>> I tried to use declarative partitioning and, to avoid creating partitions by
>> hand, to make them in ON BEFORE STATEMENT trigger. Trigger executes
>> successfully (proved that with RAISE NOTICE), but server crashes.

> The problem here is with the server allowing to create a partition of the
> table being inserted into, inside the table's BEFORE INSERT trigger.
> Generally speaking, the command that's run inside the trigger shouldn't
> have been allowed to proceed if it might change the table's properties
> that the execution of the ongoing command is depending upon.

Check.

> I propose the attached to fix that.

Hmm ... I wonder if we shouldn't do CheckTableNotInUse for *both* cases,
is_partition or no?

            regards, tom lane


pgsql-bugs by date:

Previous
From: Amit Langote
Date:
Subject: Re: BUG #15437: Segfault during insert into declarative partitionedtable with a trigger creating partition
Next
From: PG Bug reporting form
Date:
Subject: BUG #15440: pg_dump does not preserve quoted identifiers forstatement-level trigger transition table names