Search Postgresql Archives

Regarding use of single column as primary key on partitioned table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux