Re: Regarding use of single column as primary key on partitioned table

From: Christophe Pettus <xof(at)thebuild(dot)com>
To: Durgamahesh Manne <maheshpostgres9(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org, pgsql-in-general(at)postgresql(dot)org
Subject: Re: Regarding use of single column as primary key on partitioned table
Date: 2024-09-28 04:39:40
Message-ID: 9841DB8A-C3D7-42F4-9AE1-83076CAB1576@thebuild.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-in-general

> On Sep 27, 2024, at 21:25, Durgamahesh Manne <maheshpostgres9(at)gmail(dot)com> wrote:
>
> Can't we use primary key on singal column(betid) on partitioned table rather than using composite key (placedon,betid)?

No. Any unique constraint on a partitioned table must include the partition key, including a primary key constraint.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ron Johnson 2024-09-28 04:49:35 Re: Regarding use of single column as primary key on partitioned table
Previous Message David G. Johnston 2024-09-28 04:39:21 Re: Regarding use of single column as primary key on partitioned table

Browse pgsql-in-general by date

  From Date Subject
Next Message Ron Johnson 2024-09-28 04:49:35 Re: Regarding use of single column as primary key on partitioned table
Previous Message David G. Johnston 2024-09-28 04:39:21 Re: Regarding use of single column as primary key on partitioned table