Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
SnowHill9902
on July 11, 2022
|
parent
|
context
|
favorite
| on:
Postgres 15 improves UNIQUE and NULL
Doesn’t feel natural in Postgres. I’d check an auxiliary table nodes_nodes (integer, integer) having an index of all ancestor-descendants.
evv
on July 11, 2022
[–]
Agree its a bit unnatural, but it seems workable. My problem with the auxiliary table is, I wouldn't know how to implement the unique constraint.
SnowHill9902
on July 11, 2022
|
parent
[–]
In your current implementation you either have no unique constraint or it is a more particular case of UNIQUE(ancestor, descendant).
Consider applying for YC's Summer 2025 batch! Applications are open till May 13
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: