pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Ron <ronljohnsonjr@gmail.com>
Cc: pgsql-admin@lists.postgresql.org
Subject: Re: Partitioning on the date part of a timestamp & PK issues
Date: Thu, 15 Jul 2021 22:53:12 -0400
Message-ID: <202107160253.va6esfntkuxr@alvherre.pgsql> (raw)
In-Reply-To: <60a7d2e0-787e-68fe-28d6-40ec32d11c0f@gmail.com>

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)





view thread (10+ messages)  latest in thread

Message-ID: <202107160253.va6esfntkuxr@alvherre.pgsql>
Permalink:  ../202107160253.va6esfntkuxr@alvherre.pgsql/
Also on:    postgresql.org/message-id/202107160253.va6esfntkuxr@alvherre.pgsql

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: alvherre@alvh.no-ip.org, ronljohnsonjr@gmail.com, pgsql-admin@lists.postgresql.org
  Subject: Re: Partitioning on the date part of a timestamp & PK issues
  In-Reply-To: <202107160253.va6esfntkuxr@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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