When the following snippet is executed in h2 databse (compatibility POSTGRESQL) I encounter syntax error which seems to be reported by h2:
org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "
ALTER TABLE ACTIVITIES
ADD CONSTRAINT FK_ACT_NEXACTID FOREIGN KEY (NEXTACTIVITYID)
REFERENCES ACTIVITIES (ID)
DEFERRABLE INITIALLY[*] DEFERRED
"; SQL statement:
----------------------------------------------------------------------
-- ACTIVITIES
----------------------------------------------------------------------
ALTER TABLE ACTIVITIES
ADD CONSTRAINT FK_ACT_NEXACTID FOREIGN KEY (NEXTACTIVITYID)
REFERENCES ACTIVITIES (ID)
DEFERRABLE INITIALLY DEFERRED
[42000-198]
SQL State is 42000 which is the code for syntax error. When I execute it on native postgre server it runs without errors. Any help is appreciated. I read here H2 - (Quite) long INSERT failing with error 42000 that some extra character can be the reason for this but I do not see any. Thank you!