H2 v2.0.206 support for NEXTVAL

1,026 views
Skip to first unread message

Paul Denby

unread,
Jan 12, 2022, 7:16:26 AM1/12/22
to H2 Database
Overriding Spring Boot h2.version to 2.0.206 (from 1.4.200) throws an error  

Column \"TABLE1_ID_SEQ.NEXTVAL\" not found

in the following SQL which worked previously:

CREATE SEQUENCE table1_id_seq;

CREATE TABLE  table1 (
id integer default table1_id_seq.nextval NOT NULL UNIQUE,
versionid integer NOT NULL,
table2id integer,
externalid character varying(255),
value character varying(255)
);

Neither of the documented alternate forms worked either:

... default nextval('table1_id_seq') ...

or

... default next value for table1_id_seq ...

Is there a preferred version of getting nextval in h2 v2.0.206, or any other way of getting an id from a sequence (for various reasons this is a requirement)?

Henning Pöttker

unread,
Jan 12, 2022, 7:52:09 AM1/12/22
to h2-da...@googlegroups.com
The problem is in Spring JDBC: https://github.com/spring-projects/spring-framework/pull/27870

It will be fixed in release 5.3.15 which should be released latest next week.

--
You received this message because you are subscribed to the Google Groups "H2 Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to h2-database...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/h2-database/6dc31aec-89ff-45cf-a3fc-d7a8a2830727n%40googlegroups.com.

Paul Denby

unread,
Jan 12, 2022, 9:20:47 AM1/12/22
to H2 Database
Many thanks. Will try again when the spring version is available.
Reply all
Reply to author
Forward
0 new messages