Re: Partitioning on the date part of a timestamp & PK issues

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Ron <ronljohnsonjr(at)gmail(dot)com>
Cc: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: Partitioning on the date part of a timestamp & PK issues
Date: 2021-07-16 02:53:12
Message-ID: 202107160253.va6esfntkuxr@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On 2021-Jul-15, Ron wrote:

> CREATE TABLE t (
>     guid uuid not null,
>     seq smallint not null,
>     tid smallint not null,
>     ts timestamp without time zone not null,
>     x real,
>     y real,
>     z real,
>     primary key (guid, tid, seq, ts)
> )   partition by range (ts);

This definition will let you have multiple rows for the same
(guid,tid,seq) combination, as long as they have different ts values.
That is at odds with the original formulation, in which there could be a
single row with any given combination of those three columns.

--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
"Having your biases confirmed independently is how scientific progress is
made, and hence made our great society what it is today" (Mary Gardiner)

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Ron 2021-07-16 03:45:12 Re: Partitioning on the date part of a timestamp & PK issues
Previous Message Wells Oliver 2021-07-15 22:58:42 Re: Partitioning on the date part of a timestamp & PK issues