Regarding use of single column as primary key on partitioned table

Поиск
Список
Период
Сортировка
От Durgamahesh Manne
Тема Regarding use of single column as primary key on partitioned table
Дата
Msg-id CAJCZko+pA8o3HDBuGzxzYjMo=Gm_8yBLk7Sod3Fdo-i0WAwLuA@mail.gmail.com
обсуждение исходный текст
Ответы Re: Regarding use of single column as primary key on partitioned table
Re: Regarding use of single column as primary key on partitioned table
Список pgsql-general
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

В списке pgsql-general по дате отправления: