💡 Need Global Uniqueness Across Partitions?
Although YSQL does not provide a native global unique index across declarative partitions, there are schema-level patterns you can use when global uniqueness is required.
Here are two approaches you can consider:
Caveat: this approach performs an additional lookup as part of the constraint check and may not scale well for high-volume INSERTs or bulk loads.
Caveat: this adds an additional table write and trigger execution to the INSERT path, so it can also become a scalability consideration for write-heavy workloads.
These are workaround patterns, not native global indexes. Test their concurrency, write throughput, and operational behavior carefully with your actual workload before choosing either approach.