pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Range partitioning and overlap
6+ messages / 3 participants
[nested] [flat]

Commits from this thread:
  2020-11-14 dbca94510c 2b77595085 a87d7801c2 0e0e71abdc  Doc: improve partitioning discussion in ddl.sgml.
* Range partitioning and overlap
@ 2020-11-13 20:29  Edson Richter <edsonrichter@hotmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Edson Richter @ 2020-11-13 20:29 UTC (permalink / raw)
  To: pgsql-general <pgsql-general@postgresql.org>

Hi,

Using PostgreSQL 13.1 - I need your guidance about corretly implementing partition by timestamp ranges.

Looking at documentation ( https://www.postgresql.org/docs/13/ddl-partitioning.html ) there a statement saying explicit

"Range Partitioning

The table is partitioned into “ranges” defined by a key column or set of columns, with no overlap between the ranges of values assigned to different partitions. For example, one might partition by date ranges, or by ranges of identifiers for particular business objects."


But afterwards, looking into examples, the ranges overlaps:


CREATE TABLE measurement_y2006m02 PARTITION OF measurement
    FOR VALUES FROM ('2006-02-01') TO ('2006-03-01');

CREATE TABLE measurement_y2006m03 PARTITION OF measurement
    FOR VALUES FROM ('2006-03-01') TO ('2006-04-01');

...
CREATE TABLE measurement_y2007m11 PARTITION OF measurement
    FOR VALUES FROM ('2007-11-01') TO ('2007-12-01');

CREATE TABLE measurement_y2007m12 PARTITION OF measurement
    FOR VALUES FROM ('2007-12-01') TO ('2008-01-01')
    TABLESPACE fasttablespace;

Is there a misinterpretation from my side, or examples are inconsistent with the paragraph above?

Thanks,

Edson

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Range partitioning and overlap
@ 2020-11-13 20:32  David G. Johnston <david.g.johnston@gmail.com>
  parent: Edson Richter <edsonrichter@hotmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: David G. Johnston @ 2020-11-13 20:32 UTC (permalink / raw)
  To: Edson Richter <edsonrichter@hotmail.com>; +Cc: pgsql-general <pgsql-general@postgresql.org>

On Fri, Nov 13, 2020 at 1:29 PM Edson Richter <edsonrichter@hotmail.com>
wrote:

> "Range Partitioning
>
> The table is partitioned into “ranges” defined by a key column or set of
> columns, with no overlap between the ranges of values assigned to different
> partitions. For example, one might partition by date ranges, or by ranges
> of identifiers for particular business objects."
> Is there a misinterpretation from my side, or examples are inconsistent
> with the paragraph above?
>

Further on the documentation: "When creating a range partition, the lower
bound specified with FROM is an inclusive bound, whereas the upper bound
specified with TO is an exclusive bound."

David J.

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* RE: Range partitioning and overlap
@ 2020-11-13 20:46  Edson Richter <edsonrichter@hotmail.com>
  parent: David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Edson Richter @ 2020-11-13 20:46 UTC (permalink / raw)
  To: David G. Johnston <david.g.johnston@gmail.com>; +Cc: pgsql-general <pgsql-general@postgresql.org>


De: David G. Johnston <david.g.johnston@gmail.com>
Enviado: sexta-feira, 13 de novembro de 2020 17:32
Para: Edson Richter <edsonrichter@hotmail.com>
Cc: pgsql-general <pgsql-general@postgresql.org>
Assunto: Re: Range partitioning and overlap

On Fri, Nov 13, 2020 at 1:29 PM Edson Richter <edsonrichter@hotmail.com<mailto:edsonrichter@hotmail.com>> wrote:
"Range Partitioning

The table is partitioned into “ranges” defined by a key column or set of columns, with no overlap between the ranges of values assigned to different partitions. For example, one might partition by date ranges, or by ranges of identifiers for particular business objects."

Is there a misinterpretation from my side, or examples are inconsistent with the paragraph above?

Further on the documentation: "When creating a range partition, the lower bound specified with FROM is an inclusive bound, whereas the upper bound specified with TO is an exclusive bound."

David J.

I'm pretty sure I cannot find this statement in PostgreSQL 13 documentation page about partitioning. May be this statement is in another page?
Would you mind to share the URL with this statement?

Thanks,

Edson

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Range partitioning and overlap
@ 2020-11-13 20:58  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Edson Richter <edsonrichter@hotmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Tom Lane @ 2020-11-13 20:58 UTC (permalink / raw)
  To: Edson Richter <edsonrichter@hotmail.com>; +Cc: David G. Johnston <david.g.johnston@gmail.com>; pgsql-general <pgsql-general@postgresql.org>

Edson Richter <edsonrichter@hotmail.com> writes:
> Further on the documentation: "When creating a range partition, the lower bound specified with FROM is an inclusive bound, whereas the upper bound specified with TO is an exclusive bound."

> I'm pretty sure I cannot find this statement in PostgreSQL 13 documentation page about partitioning. May be this statement is in another page?

It's in the CREATE TABLE reference page.  Seems like it would be a good
idea to have it also in ddl.sgml's discussion of partitioning, though.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* RE: Range partitioning and overlap
@ 2020-11-13 21:08  Edson Richter <edsonrichter@hotmail.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 6+ messages in thread

From: Edson Richter @ 2020-11-13 21:08 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: David G. Johnston <david.g.johnston@gmail.com>; pgsql-general <pgsql-general@postgresql.org>

De: Tom Lane <tgl@sss.pgh.pa.us>
Enviado: sexta-feira, 13 de novembro de 2020 17:58
Para: Edson Richter <edsonrichter@hotmail.com>
Cc: David G. Johnston <david.g.johnston@gmail.com>; pgsql-general <pgsql-general@postgresql.org>
Assunto: Re: Range partitioning and overlap

Edson Richter <edsonrichter@hotmail.com> writes:
> Further on the documentation: "When creating a range partition, the lower bound specified with FROM is an inclusive bound, whereas the upper bound specified with TO is an exclusive bound."

> I'm pretty sure I cannot find this statement in PostgreSQL 13 documentation page about partitioning. May be this statement is in another page?

It's in the CREATE TABLE reference page.  Seems like it would be a good
idea to have it also in ddl.sgml's discussion of partitioning, though.

                        regards, tom lane

Thanks!

Regards,

Edson

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Range partitioning and overlap
@ 2020-11-15 04:53  David G. Johnston <david.g.johnston@gmail.com>
  parent: Edson Richter <edsonrichter@hotmail.com>
  0 siblings, 0 replies; 6+ messages in thread

From: David G. Johnston @ 2020-11-15 04:53 UTC (permalink / raw)
  To: Edson Richter <edsonrichter@hotmail.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-general <pgsql-general@postgresql.org>

On Fri, Nov 13, 2020 at 2:08 PM Edson Richter <edsonrichter@hotmail.com>
wrote:

> *De:* Tom Lane <tgl@sss.pgh.pa.us>
> *Enviado:* sexta-feira, 13 de novembro de 2020 17:58
> *Para:* Edson Richter <edsonrichter@hotmail.com>
> *Cc:* David G. Johnston <david.g.johnston@gmail.com>; pgsql-general <
> pgsql-general@postgresql.org>
> *Assunto:* Re: Range partitioning and overlap
>
> Edson Richter <edsonrichter@hotmail.com> writes:
> > Further on the documentation: "When creating a range partition, the
> lower bound specified with FROM is an inclusive bound, whereas the upper
> bound specified with TO is an exclusive bound."
>
> > I'm pretty sure I cannot find this statement in PostgreSQL 13
> documentation page about partitioning. May be this statement is in another
> page?
>
> It's in the CREATE TABLE reference page.  Seems like it would be a good
> idea to have it also in ddl.sgml's discussion of partitioning, though.
>
>
Patch thread with commit:

https://www.postgresql.org/message-id/DM6PR13MB3988736CF8F5DC5720440231CFE60@DM6PR13MB3988.namprd13....

David J.

^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2020-11-15 04:53 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-11-13 20:29 Range partitioning and overlap Edson Richter <edsonrichter@hotmail.com>
2020-11-13 20:32 ` David G. Johnston <david.g.johnston@gmail.com>
2020-11-13 20:46   ` Edson Richter <edsonrichter@hotmail.com>
2020-11-13 20:58     ` Tom Lane <tgl@sss.pgh.pa.us>
2020-11-13 21:08       ` Edson Richter <edsonrichter@hotmail.com>
2020-11-15 04:53         ` David G. Johnston <david.g.johnston@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox