Re: [HACKERS] Rules on table partitions

2017-06-21 Thread Amit Langote
On 2017/06/21 18:49, Dean Rasheed wrote: > On 20 June 2017 at 03:01, Amit Langote 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

Re: [HACKERS] Rules on table partitions

2017-06-21 Thread Dean Rasheed
On 20 June 2017 at 03:01, Amit Langote 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

Re: [HACKERS] Rules on table partitions

2017-06-20 Thread Amit Langote
On 2017/06/20 17:51, Dean Rasheed wrote: > On 20 June 2017 at 03:01, Amit Langote wrote: >> On 2017/06/19 20:19, Dean Rasheed wrote: >>> Perhaps we >>> should explicitly forbid this for now -- i.e., raise a "not supported" >>> error when attempting to add a rule to

Re: [HACKERS] Rules on table partitions

2017-06-20 Thread Dean Rasheed
On 20 June 2017 at 03:01, Amit Langote wrote: > On 2017/06/19 20:19, Dean Rasheed wrote: >> Currently we allow rules to be defined on table partitions, but these >> rules only fire when the partition is accessed directly, not when it >> is accessed via the parent: >

Re: [HACKERS] Rules on table partitions

2017-06-19 Thread Amit Langote
Hi Dean, On 2017/06/19 20:19, Dean Rasheed wrote: > Currently we allow rules to be defined on table partitions, but these > rules only fire when the partition is accessed directly, not when it > is accessed via the parent: Yeah, the same thing as will happen with an inheritance setup, but I

Re: [HACKERS] Rules on table partitions

2017-06-19 Thread Peter Eisentraut
On 6/19/17 07:19, Dean Rasheed wrote: > Currently we allow rules to be defined on table partitions, but these > rules only fire when the partition is accessed directly, not when it > is accessed via the parent That's what I would have expected, but I realize that there are always multiple ways to

[HACKERS] Rules on table partitions

2017-06-19 Thread Dean Rasheed
Currently we allow rules to be defined on table partitions, but these rules only fire when the partition is accessed directly, not when it is accessed via the parent: CREATE TABLE t1(a int, b int) PARTITION BY RANGE(a); CREATE TABLE t1_p PARTITION OF t1 FOR VALUES FROM (1) TO (10); INSERT INTO t1