Re:PostgreSQL and SQL:2023
by paulddraper on Friday June 02, 2023 @11:52AM
(#36166778)
> Support for arrays of foreign keys.
Standards-wise, the first step would be arrays in general :)
> Support for deferring NOT NULL and CHECK constraints to the end of a transaction
Agreed 100%
Re:PostgreSQL and SQL:2023
by meotimdihia on Friday June 02, 2023 @12:04PM
(#36166916)
Is there a database that supported arrays of foreign keys?
We use it in Palantir, that is a proprietary overlay on top of Spark.
It supports this feature reasonably fine.
Re:PostgreSQL and SQL:2023
by paulddraper on Friday June 02, 2023 @04:51PM
(#36170581)
Of the major databases, only Oracle and PostgreSQL have array extensions and neither support FKs as array elements.
I'm curious how people think this feature should work? ON DELETE SET NULL, ON DELETE CASCADE, something else?
I would love it if the would remove the key from the array.
“Array of foreign keys” has been at the top of my list for so long. Would simplify sooooo much.
I followed the link about arrays of foreign keys but couldn't see what it was saying. Could you briefly summarise for me?
Re:PostgreSQL and SQL:2023
by petereisentraut on Saturday June 03, 2023 @08:07AM
(#36175956)
> - Support for deferring NOT NULL and CHECK constraints to the end of a transaction (just ran into this problem yesterday)
I'm curious what the use case of this is?
Deferrable constraints are usually considered for foreign keys, since there you might have to juggle updates to multiple tables and might violate the constraint in the intermediate states. But that doesn't appear to apply in that way to CHECK constraints.
- Support for arrays of foreign keys. This one has been worked on a couple of times but hasn't made it into a release. https://commitfest.postgresql.org/17/1252/ - I think this would be an absolutely phenomenal way of handling sorting, instead of having to use linked lists and CTEs or some type of "order/position" column
- Support for deferring NOT NULL and CHECK constraints to the end of a transaction (just ran into this problem yesterday)
Edit: typos