Re: literal vs dynamic partition constraint in plan execution

2019-09-03 Thread Michael Lewis
I think I would expect this behavior with how you have defined the constraints as the function results rather than just being strict comparisons to the timestamp field. Instead of this- Check constraints: > "y2018_mis_ora_check" CHECK (date_part('year'::text, mis_ora) = > 2018::double precisio

Re: partition by range or by list constraint check (was Re: literal vs dynamic partition constraint in plan execution)

2019-09-02 Thread Tom Lane
Luca Ferrari writes: > I've done a simple test case, and find out that probably the problem I > got was due to the partition schema I'm using. > I want a table to be partitioned by a timestamp field with a first > level partition by year, and a second level by month. Therefore, I did > a BY LIST p

partition by range or by list constraint check (was Re: literal vs dynamic partition constraint in plan execution)

2019-09-02 Thread Luca Ferrari
I've done a simple test case, and find out that probably the problem I got was due to the partition schema I'm using. I want a table to be partitioned by a timestamp field with a first level partition by year, and a second level by month. Therefore, I did a BY LIST partitioning, but that produces a

Re: literal vs dynamic partition constraint in plan execution

2019-08-30 Thread Luca Ferrari
On Fri, Aug 30, 2019 at 8:29 AM Luca Ferrari wrote: > testdb=># \d+ respi.y2018 > ... > Partition of: respi.root FOR VALUES IN ('2018') > Partition constraint: ((date_part('year'::text, mis_ora) IS NOT NULL) > AND (date_part('year'::text, mis_ora) = '2018'::double precision)) > Partition key: LIST

Re: literal vs dynamic partition constraint in plan execution

2019-08-29 Thread Luca Ferrari
On Thu, Aug 29, 2019 at 4:45 PM Luca Ferrari wrote: > > Ok, the title is a little buzz, however I've got a partitioned table > and one "leaf" has a set of checks against a timestamp field to ensure > that tuples within such table belongs to the year and month: Of course, all the siblings have sim

literal vs dynamic partition constraint in plan execution

2019-08-29 Thread Luca Ferrari
Ok, the title is a little buzz, however I've got a partitioned table and one "leaf" has a set of checks against a timestamp field to ensure that tuples within such table belongs to the year and month: testdb=# \d respi.y2019m08 ... Partition of: respi.y2019 FOR VALUES IN ('8') Check constraints: