Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m4Dyc-00081U-1f for pgsql-admin@arkaria.postgresql.org; Fri, 16 Jul 2021 02:53:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m4Dyb-0007Tx-1A for pgsql-admin@arkaria.postgresql.org; Fri, 16 Jul 2021 02:53:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m4Dya-0007Tp-OQ for pgsql-admin@lists.postgresql.org; Fri, 16 Jul 2021 02:53:20 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m4DyY-0003j8-4j for pgsql-admin@lists.postgresql.org; Fri, 16 Jul 2021 02:53:20 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 20B695C0110; Thu, 15 Jul 2021 22:53:16 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 15 Jul 2021 22:53:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=mDf03yFqPelNYBnM37G0vT/aPHQEueaHGw+Pb7VNF/w=; b=LhKBDrnL /LuiUYQgBvD82fn7ZMv93WI4OsAPfg6f8Fq4kyTu/CM2oN7hsw68Qq1MURLqzo2Z TGi2O2ApeliG7URjNK/ekFF4RQuhqZL7o0LhdA3hXSkwGRHwP6/7whKagQ7Yq7DR 90s/+QzhdC6w8II2PKNLayi/FH6UDBeM9C0u67L6JPnYVLUb3H7AHNV+fOaGhvaB jLtkP3PLZASmALeFEAfQpyXxcJtTSaOfKyts5SWxZOABNKrTjoPgdRgQ4A6uQAXf Z9+6fdGeiz+NPYtmHoRCYbeCdQ1x3eQrwK4IyL/fHoliDRrqjP7PWkx5PPJT3rmb wNLZZKyIZpzg+Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvddvgdehkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfggtggugfgjsehtkeertd dttdejnecuhfhrohhmpeetlhhvrghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvges rghlvhhhrdhnohdqihhprdhorhhgqeenucggtffrrghtthgvrhhnpedujeevjeffjeevud dutedvkeeiueeitddvieelfeekveejudefgeeuvdejhfeuleenucffohhmrghinhepvghn thgvrhhprhhishgvuggsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 15 Jul 2021 22:53:15 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 6FE0D2A099B; Thu, 15 Jul 2021 22:53:12 -0400 (-04) Date: Thu, 15 Jul 2021 22:53:12 -0400 From: Alvaro Herrera To: Ron Cc: pgsql-admin@lists.postgresql.org Subject: Re: Partitioning on the date part of a timestamp & PK issues Message-ID: <202107160253.va6esfntkuxr@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <60a7d2e0-787e-68fe-28d6-40ec32d11c0f@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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)