Re: no default hash partition

2019-08-08 Thread Alvaro Herrera
On 2019-Aug-08, Amit Langote wrote: > On Thu, Aug 8, 2019 at 6:22 AM Tom Lane wrote: > > OK, but maybe also s/created as a default partition/created as the default > > partition/ ? Writing "a" carries the pretty clear implication that there > > can be more than one, and contradicting that a sen

Re: no default hash partition

2019-08-07 Thread Amit Langote
On Thu, Aug 8, 2019 at 6:22 AM Tom Lane wrote: > Alvaro Herrera writes: > > On 2019-Aug-07, Tom Lane wrote: > >> Hm, that's rather confusingly worded IMO. Is the antecedent of "this > >> option" just DEFAULT, or does it mean that you can't use FOR VALUES, > >> or perchance it means that you can'

Re: no default hash partition

2019-08-07 Thread Tom Lane
Alvaro Herrera writes: > On 2019-Aug-07, Tom Lane wrote: >> Hm, that's rather confusingly worded IMO. Is the antecedent of "this >> option" just DEFAULT, or does it mean that you can't use FOR VALUES, >> or perchance it means that you can't use a PARTITION OF clause >> at all? > Uh, you're right

Re: no default hash partition

2019-08-07 Thread Tom Lane
Alvaro Herrera writes: > Actually, it also says this (in the blurb for the PARTITION OF clause): > Creates the table as a partition of the specified > parent table. The table can be created either as a partition for > specific > values using FOR VALUES or as a default partition

Re: no default hash partition

2019-08-07 Thread Alvaro Herrera
On 2019-Aug-07, Tom Lane wrote: > Alvaro Herrera writes: > > Actually, it also says this (in the blurb for the PARTITION OF clause): > > > Creates the table as a partition of the > > specified > > parent table. The table can be created either as a partition for > > specific > >

Re: no default hash partition

2019-08-07 Thread Alvaro Herrera
On 2019-Aug-07, Amit Langote wrote: > That hash-partitioned tables can't have default partition is mentioned > in the CREATE TABLE page: > > "If DEFAULT is specified, the table will be created as a default > partition of the parent table. The parent can either be a list or > range partitioned tab

Re: no default hash partition

2019-08-07 Thread Alvaro Herrera
On 2019-Aug-06, Stephen Frost wrote: > Yeah, that's a fair argument, but giving the user a way to say that > would address it. As in, "create me a list-partitioned table for these > values, plus a default." Anyhow, I'm sure that I'm taking this beyond > what we need to do right now, just sharing

Re: no default hash partition

2019-08-07 Thread Alvaro Herrera
On 2019-Aug-07, Amit Langote wrote: > That hash-partitioned tables can't have default partition is mentioned > in the CREATE TABLE page: > > "If DEFAULT is specified, the table will be created as a default > partition of the parent table. The parent can either be a list or > range partitioned tab

Re: no default hash partition

2019-08-07 Thread Stephen Frost
Greetings, * Amit Langote (amitlangot...@gmail.com) wrote: > On Wed, Aug 7, 2019 at 1:59 PM Kyotaro Horiguchi > wrote: > > At Tue, 6 Aug 2019 23:26:19 -0400, Robert Haas > > wrote: > > > On Tue, Aug 6, 2019 at 6:58 PM Tom Lane wrote: > > > I think, as Amit says, that having an automatic partit

Re: no default hash partition

2019-08-07 Thread Magnus Hagander
On Wed, Aug 7, 2019 at 5:26 AM Robert Haas wrote: > On Tue, Aug 6, 2019 at 6:58 PM Tom Lane wrote: > > Hmm. So given the point about it being hard to predict which hash > > partitions would receive what values ... under what circumstances > > would it be sensible to not create a full set of par

Re: no default hash partition

2019-08-06 Thread Amit Langote
Horiguchi-san, On Wed, Aug 7, 2019 at 1:59 PM Kyotaro Horiguchi wrote: > At Tue, 6 Aug 2019 23:26:19 -0400, Robert Haas wrote: > > On Tue, Aug 6, 2019 at 6:58 PM Tom Lane wrote: > > I think, as Amit says, that having an automatic partition creation > > feature for hash partitions (and maybe oth

Re: no default hash partition

2019-08-06 Thread Kyotaro Horiguchi
At Tue, 6 Aug 2019 23:26:19 -0400, Robert Haas wrote in > On Tue, Aug 6, 2019 at 6:58 PM Tom Lane wrote: > I think, as Amit says, that having an automatic partition creation > feature for hash partitions (and maybe other kinds, but certainly for > hash) would be a useful thing to add to the sys

Re: no default hash partition

2019-08-06 Thread David Fetter
On Tue, Aug 06, 2019 at 06:58:44PM -0400, Tom Lane wrote: > Alvaro Herrera writes: > > On 2019-Aug-06, Tom Lane wrote: > >> Seems like "it's likely to cause trouble for users" is just going to > >> beg the question "why?". Can we explain the hazard succinctly? > >> Or point to a comment somewhere

Re: no default hash partition

2019-08-06 Thread Robert Haas
On Tue, Aug 6, 2019 at 6:58 PM Tom Lane wrote: > Hmm. So given the point about it being hard to predict which hash > partitions would receive what values ... under what circumstances > would it be sensible to not create a full set of partitions? Should > we just enforce that there is a full set,

Re: no default hash partition

2019-08-06 Thread Amit Langote
Hi, On Wed, Aug 7, 2019 at 8:02 AM Stephen Frost wrote: > * Tom Lane (t...@sss.pgh.pa.us) wrote: > > Alvaro Herrera writes: > > > On 2019-Aug-06, Tom Lane wrote: > > >> Seems like "it's likely to cause trouble for users" is just going to > > >> beg the question "why?". Can we explain the hazard

Re: no default hash partition

2019-08-06 Thread Amit Langote
Hi Alvaro, On Wed, Aug 7, 2019 at 7:27 AM Alvaro Herrera wrote: > > Given the discussion starting at > https://postgr.es/m/cafjfprdbiqjzm8sg9+s0x8re-afhds6mflgguw0wvunlgrv...@mail.gmail.com > we don't have default-partition support with the hash partitioning > scheme. That seems a reasonable out

Re: no default hash partition

2019-08-06 Thread Stephen Frost
Greetings, * Tom Lane (t...@sss.pgh.pa.us) wrote: > Stephen Frost writes: > > * Tom Lane (t...@sss.pgh.pa.us) wrote: > >> Hmm. So given the point about it being hard to predict which hash > >> partitions would receive what values ... under what circumstances > >> would it be sensible to not crea

Re: no default hash partition

2019-08-06 Thread Tom Lane
Stephen Frost writes: > * Tom Lane (t...@sss.pgh.pa.us) wrote: >> Hmm. So given the point about it being hard to predict which hash >> partitions would receive what values ... under what circumstances >> would it be sensible to not create a full set of partitions? Should >> we just enforce that

Re: no default hash partition

2019-08-06 Thread Stephen Frost
Greetings, * Tom Lane (t...@sss.pgh.pa.us) wrote: > Alvaro Herrera writes: > > On 2019-Aug-06, Tom Lane wrote: > >> Seems like "it's likely to cause trouble for users" is just going to > >> beg the question "why?". Can we explain the hazard succinctly? > >> Or point to a comment somewhere else t

Re: no default hash partition

2019-08-06 Thread Tom Lane
Alvaro Herrera writes: > On 2019-Aug-06, Tom Lane wrote: >> Seems like "it's likely to cause trouble for users" is just going to >> beg the question "why?". Can we explain the hazard succinctly? >> Or point to a comment somewhere else that explains it? > Right ... the "trouble" is just that if t

Re: no default hash partition

2019-08-06 Thread Alvaro Herrera
On 2019-Aug-06, Tom Lane wrote: > Alvaro Herrera writes: > > Given the discussion starting at > > https://postgr.es/m/cafjfprdbiqjzm8sg9+s0x8re-afhds6mflgguw0wvunlgrv...@mail.gmail.com > > we don't have default-partition support with the hash partitioning > > scheme. That seems a reasonable outc

Re: no default hash partition

2019-08-06 Thread Tom Lane
Alvaro Herrera writes: > Given the discussion starting at > https://postgr.es/m/cafjfprdbiqjzm8sg9+s0x8re-afhds6mflgguw0wvunlgrv...@mail.gmail.com > we don't have default-partition support with the hash partitioning > scheme. That seems a reasonable outcome, but I think we should have a > comment