Failed to change "not null" option on a column on version 1.4.199

18 views
Skip to first unread message

nzanaga

unread,
Oct 7, 2019, 3:49:00 AM10/7/19
to H2 Database
Hi, with driver version "1.4.199" query to alter column to modify not null options fails.
Using versione "1.4.197" this works fine.

Query:

CREATE TABLE test1 (
    a integer
)


ALTER TABLE test1 ALTER COLUMN a SET DATA TYPE  INTEGER  NOT NULL

Evgenij Ryazanov

unread,
Oct 7, 2019, 4:43:37 AM10/7/19
to H2 Database
Hello.

Your command is definitely not valid. Where did you find it? We don't have such syntax in the documentation. It was accepted due to bug.

Use
ALTER TABLE tableName ALTER COLUMN columnName SET NOT NULL
instead.

The SET DATA TYPE clause may be used only to change the data type of the column, it is officially supported since 1.4.198.
Reply all
Reply to author
Forward
0 new messages