Re: [HACKERS] Rules on table partitions - Mailing list pgsql-hackers

From Amit Langote
Subject Re: [HACKERS] Rules on table partitions
Date
Msg-id 589e1125-3d5d-55f3-b39f-09d901b5a9b4@lab.ntt.co.jp
Whole thread Raw
In response to Re: [HACKERS] Rules on table partitions  (Dean Rasheed <dean.a.rasheed@gmail.com>)
List pgsql-hackers
On 2017/06/21 18:49, Dean Rasheed wrote:
> On 20 June 2017 at 03:01, Amit Langote <Langote_Amit_f8@lab.ntt.co.jp> wrote:
>> Hmm, yes.  The following exercise convinced me.
>>
>> create table r (a int) partition by range (a);
>> create table r1 partition of r for values from (1) to (10);
>> create rule "_RETURN" as on select to r1 do instead select * from r;
>>
>> insert into r values (1);
>> ERROR:  cannot insert into view "r1"
>> HINT:  To enable inserting into the view, provide an INSTEAD OF INSERT
>> trigger or an unconditional ON INSERT DO INSTEAD rule.
>>
>> The error is emitted by CheckValidResultRel() that is called on individual
>> leaf partitions when setting up tuple-routing in ExecInitModifyTable.
>>
>> I agree that we should forbid this case, so please find attached a patch.
>>
> 
> Committed.

Thanks, Dean.

Regards,
Amit




pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: [HACKERS] PATCH: Batch/pipelining support for libpq
Next
From: Thomas Munro
Date:
Subject: Re: [HACKERS] ASOF join