Re: Declarative partitioning grammar - Mailing list pgsql-hackers

From Zeugswetter Andreas ADI SD
Subject Re: Declarative partitioning grammar
Date
Msg-id E1539E0ED7043848906A8FF995BDA57902B625F2@m0143.s-mxs.net
Whole thread Raw
In response to Re: Declarative partitioning grammar  (Markus Schiltknecht <markus@bluegap.ch>)
Responses Re: Declarative partitioning grammar  (Markus Schiltknecht <markus@bluegap.ch>)
Re: Declarative partitioning grammar  (Markus Schiltknecht <markus@bluegap.ch>)
List pgsql-hackers
> > I don't agree with that at all.  I can imagine plenty of situations
> > where a tuple falling outside the range of available partitions
*should*
> > be treated as an error.  For instance, consider timestamped
observations
> > --- data in the future is certainly bogus, and data further back
than
> > you want to deal with must be an entry error as well.
>
> Isn't it better to have these constraints as table constraints,
instead
> of burying them in the partitioning definition? Mixing those two
> concepts seems very wired to me.

Yes, but the problem with the timestamp partitioned tables is, that the
window is sliding. Thus you would need two alter tables for each new
period. One that changes the constraint + one that creates the new
partition. So it seems natural to join the two concepts for such a
partitioning syntax.

Personally I find the automatic partition idea intriguing, where you
only have to choose an expression that equates to one value (value
group) per partition (and possibly a way to derive a partition name).
Then a partition is automatically created when a new row arrives for a
new value. That does not however address Tom's concern of rejecting data
that is outside the acceptable window, but maybe that is better dealt
with in the application anyways.

Andreas


pgsql-hackers by date:

Previous
From: Markus Schiltknecht
Date:
Subject: Re: Declarative partitioning grammar
Next
From: Markus Schiltknecht
Date:
Subject: Re: Declarative partitioning grammar