In the following simple table
CREATE TABLE foo (
things VARCHAR ARRAY
);
It's possible to insert null
as an element of things
:
INSERT INTO foo VALUES ('{"hi", null, "ho"}');
But I'd like to not allow this.
Changing the definition to the following, however,
CREATE TABLE foo (
things VARCHAR ARRAY NOT NULL
);
Only prevents this
INSERT INTO foo VALUES (null);
which is not what I want. (I still want to allow that.)
So how can I declare not the column, but the elements of the array column to be non-nullable?