On Sat, Sep 28, 2024 at 12:55 AM Tom Lane wrote:
> Ron Johnson writes:
> > On Sat, Sep 28, 2024 at 12:39 AM David G. Johnston <
> > david.g.johns...@gmail.com> wrote:
> >> On Friday, September 27, 2024, Durgamahesh Manne <
> >>> Can't we use primary key on singal column(betid) on partitioned tab
Ron Johnson writes:
> On Sat, Sep 28, 2024 at 12:39 AM David G. Johnston <
> david.g.johns...@gmail.com> wrote:
>> On Friday, September 27, 2024, Durgamahesh Manne <
>>> Can't we use primary key on singal column(betid) on partitioned table
>>> rather than using composite key (placedon,betid)?
>>
On Sat, Sep 28, 2024 at 12:39 AM David G. Johnston <
david.g.johns...@gmail.com> wrote:
> On Friday, September 27, 2024, Durgamahesh Manne <
> maheshpostgr...@gmail.com> wrote:
>
>>
>> ERROR: unique constraint on partitioned table must include all
>> partitioning columns
>> DETAIL: PRIMARY KEY c
> On Sep 27, 2024, at 21:25, Durgamahesh Manne
> 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 co
On Friday, September 27, 2024, Durgamahesh Manne
wrote:
>
> ERROR: unique constraint on partitioned table must include all
> partitioning columns
> DETAIL: PRIMARY KEY constraint on table "bet" lacks column "placedon"
> which is part of the partition key.
> test=>
>
> Can't we use primary key o
Hi Team
test=> CREATE TABLE public.bet (
betid int4 NOT NULL,
externalbetid text NULL,
externalsystem text NULL,
placedon timestamptz NULL,
createdon timestamptz NULL
) partition by list (placedon) ;
CREATE TABLE
test=> alter table public.bet add primary key