Re: Declarative partitioning - another take - Mailing list pgsql-hackers

From Ashutosh Bapat
Subject Re: Declarative partitioning - another take
Date
Msg-id CAFjFpRfN1J0C7c_RhSiFJcmEOEwWfH+-kidHZ89kzWZJaqxyNg@mail.gmail.com
Whole thread Raw
In response to Re: Declarative partitioning - another take  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Responses Re: Declarative partitioning - another take  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
List pgsql-hackers
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px#ccc solid;padding-left:1ex"><span class=""><br /> > 2. A combination of constraints on the
partitionsshould be applicable to<br /> > the parent. We aren't doing that.<br /><br /></span>How about on seeing
thata RELOPT_OTHER_MEMBER_REL is partitioned parent<br /> table, we can have get_relation_constraints() include a
constantfalse<br /> clause in the list of constraints returned for<br /> relation_excluded_by_<wbr />constraints() to
processso that it is not included<br /> in the append result by way of constraint exclusion.  One more option is<br />
tomark such rels dummy in set_rel_size().<br /><br clear="all" /></blockquote></div><br /></div><div
class="gmail_extra">Iam not complaining about having parent relation there. For the people who are used to seeing the
parentrelation in the list of append relations, it may be awkward. But +1 if we can do that. If we can't do that, we
shouldat least mark with an OR of all constraints on the partitions, so that constraint exclusion can exclude it if
thereare conditions incompatible with constraints. This is what would happen in inheritance case as well, if there are
constraintson the parent. In the above example, the parent table would have constraints CHECK ((a >= 0 AND a <
250)OR (a >= 250 and a < 500) OR (a >= 500 or a < 600)). It will probably get excluded, if constraint
exclusionis smart enough to understand ORing.<br /></div><div class="gmail_extra">-- <br /><div class="gmail_signature"
data-smartmail="gmail_signature"><divdir="ltr">Best Wishes,<br />Ashutosh Bapat<br />EnterpriseDB Corporation<br />The
PostgresDatabase Company<br /></div></div></div></div> 

pgsql-hackers by date:

Previous
From: Rushabh Lathia
Date:
Subject: Re: Surprising behaviour of \set AUTOCOMMIT ON
Next
From: Michael Banck
Date:
Subject: Re: Exclude schema during pg_restore