Join Discord
Powered by
Is it possible to create an array of unique UUIDs ...
# sql
t
TMShader
03/22/2022, 1:29 PM
Is it possible to create an array of unique UUIDs column?
c
chipilov
03/22/2022, 1:41 PM
I don't think PostgreSQL has a set() built-in type (
https://www.postgresql.org/docs/9.5/datatype.html
) so I think your options are: - use an array of UUIDs and add a check constraint on the table which enforces uniqueness (maybe implemented like this
https://dba.stackexchange.com/questions/226456/how-can-i-get-a-unique-array-in-postgresql
) - Use a JSON/JSONB as the type of the col and the UUIDs will be the keys of the object (since JSON/JSONB does NOT allow repeating keys)
t
TMShader
03/22/2022, 1:47 PM
Ignore what I said if you saw it
TMShader
03/22/2022, 1:52 PM
Thanks for the help btw :)
n
Needle
03/22/2022, 1:52 PM
Thread was archived by
@TMShader
. Anyone can send a message to unarchive it.
Previous
Next