pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Partitioning Column needs to be Key
2+ messages / 2 participants
[nested] [flat]

* Partitioning Column needs to be Key
@ 2020-02-19 06:30  Vaishakha Madhava <vaishakha.madhava@314ecorp.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Vaishakha Madhava @ 2020-02-19 06:30 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org

Hi,
When we try to create partitioning table based on a column , If that table
contains a primary key or unique key ,it gives error saying "UNIQUE
constraint on table "ac"  lacks column "abc" which is part of the partition
key".

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Partitioning Column needs to be Key
@ 2020-02-19 10:11  legrand legrand <legrand_legrand@hotmail.com>
  parent: Vaishakha Madhava <vaishakha.madhava@314ecorp.com>
  0 siblings, 0 replies; 2+ messages in thread

From: legrand legrand @ 2020-02-19 10:11 UTC (permalink / raw)
  To: pgsql-bugs

Hello,
this is not supported yet.
See: https://www.postgresql.org/docs/12/ddl-partitioning.html
that says
"Unique constraints on partitioned tables must include all the partition key
columns. 
This limitation exists because PostgreSQL can only enforce uniqueness in
each partition individually."

It is because PostgreSQL doesn't have any "global index" support yet. If you
really want to partition you table on a key that is not in the partition
key, you may have a look at
www.postgresql-archive.org/PostgreSQL-11-global-index-td6032681.html

Regards
PAscal




--
Sent from: https://www.postgresql-archive.org/PostgreSQL-bugs-f2117394.html





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2020-02-19 10:11 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-02-19 06:30 Partitioning Column needs to be Key Vaishakha Madhava <vaishakha.madhava@314ecorp.com>
2020-02-19 10:11 ` legrand legrand <legrand_legrand@hotmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox