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)?
No. It would be misleading to allow such a thing because a unique index can only span a single partition.
That is IMO a serious (and probably unfixable, given how PG stores tables) flaw in PG's partitioning design.