I want to create something similar to this
CHECK (ALL(scopes) IN ('read', 'write', 'delete', 'update'))
scopes
here is a field in the table which is text[]
and I want to be sure that all the values in this array are one of the values above. Any opinions on this? And also is it possible the get these values via SELECT
from another table?
I have seen the below solution but I was curious if there is a simpler one.
Postgresql check constraint on all individual elements in array using function