public inbox for [email protected]
help / color / mirror / Atom feedFrom: Durgamahesh Manne <[email protected]>
To: [email protected]
To: [email protected]
Subject: Regarding use of single column as primary key on partitioned table
Date: Sat, 28 Sep 2024 09:55:57 +0530
Message-ID: <CAJCZko+pA8o3HDBuGzxzYjMo=Gm_8yBLk7Sod3Fdo-i0WAwLuA@mail.gmail.com> (raw)
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 (betid);
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 on singal column(betid) on partitioned table
rather than using composite key (placedon,betid)?
Regards,
Durga Mahesh
view thread (2+ messages) latest in thread
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: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Regarding use of single column as primary key on partitioned table
In-Reply-To: <CAJCZko+pA8o3HDBuGzxzYjMo=Gm_8yBLk7Sod3Fdo-i0WAwLuA@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox