Hello,
I am using H2 v2.2.224 in PostgreSQL mode. I would like to create a table in H2 with a "text" and "text[]" column. For example, in PostgreSQL I have a table like this:
CREATE TABLE COMPANY (
ID BIGSERIAL NOT NULL,
NAME text NOT NULL,
DESCRIPTION text,
NAICS text[]
);
I can successfully create a "text" column if I create a custom domain like this:
"CREATE domain IF NOT EXISTS text AS varchar"
However, if I try to create a domain for "text[]" I get an error:
"CREATE domain IF NOT EXISTS text[] AS varchar ARRAY"
org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "CREATE domain IF NOT EXISTS text[*][] AS varchar ARRAY"; expected "., AS, data type";
I think the syntax error lays in the brackets because if I replace "text[]" with "blah" it works:
"CREATE domain IF NOT EXISTS blah AS varchar ARRAY"
Any suggestions for how to get this to work? Maybe a different syntax for the "create domain" statement or a property of some sort?
Thanks in advance,
Peter