[英]HSQL postgres dialog not recognized
I want to use HSQL for integration tests. 我想使用HSQL进行集成测试。 Therefore I want to setup the test schema with exact the same script I use for production.
因此,我想使用与生产中使用的脚本完全相同的脚本来设置测试架构。 This is in postgresql dialect.
这是在PostgreSQL方言中。 In the test script I tried to set the dialect but it doesn't seem to work.
在测试脚本中,我尝试设置方言,但似乎不起作用。
At least for uuid datatype and constraints I get syntax error exceptions. 至少对于uuid数据类型和约束,我得到语法错误异常。 Eg I get a:
例如,我得到:
CREATE TABLE testtable ( id bigint NOT NULL, some_uuid uuid NOT NULL, name character varying(32) NOT NULL, CONSTRAINT testtable PRIMARY KEY (id) ) WITH ( OIDS=FALSE );
CREATE TABLE testtable(id bigint NOT NULL,some_uuid uuid NOT NULL,名称字符不可变(32)NOT NULL,CONSTRAINT testtable PRIMARY KEY(id))WITH(OIDS = FALSE); nested exception is java.sql.SQLSyntaxErrorException: type not found or user lacks privilege: UUID
嵌套异常为java.sql.SQLSyntaxErrorException:找不到类型或用户缺少特权:UUID
for the following script: 对于以下脚本:
SET DATABASE SQL SYNTAX PGS TRUE;
CREATE TABLE testtable
(
id bigint NOT NULL,
some_uuid uuid NOT NULL,
name character varying(32) NOT NULL,
CONSTRAINT testtable PRIMARY KEY (id)
)
WITH (
OIDS=FALSE
);
And I get: 我得到:
Failed to execute SQL script statement #2 of class path resource [setupTestData.sql]: CREATE TABLE testtable ( id bigint NOT NULL, name character varying(32) NOT NULL, CONSTRAINT testtable PRIMARY KEY (id) ) WITH ( OIDS=FALSE );
无法执行类路径资源[setupTestData.sql]的SQL脚本语句#2:CREATE TABLE测试表(id bigint NOT NULL,名称字符变化(32)NOT NULL,CONSTRAINT testtable主键(id))WITH(OIDS = FALSE) ; nested exception is java.sql.SQLSyntaxErrorException: unexpected token: (
嵌套异常是java.sql.SQLSyntaxErrorException:意外令牌:(
for this script: 对于此脚本:
SET DATABASE SQL SYNTAX PGS TRUE;
CREATE TABLE testtable
(
id bigint NOT NULL,
--some_uuid uuid NOT NULL,
name character varying(32) NOT NULL,
CONSTRAINT testtable PRIMARY KEY (id)
)
WITH (
OIDS=FALSE
);
HSQLDB 2.3.4 and later supports UUID. HSQLDB 2.3.4和更高版本支持UUID。
HSQLDB does not currently support the PostgreSQL extension WITH (ODS= FALSE)
HSQLDB当前不支持PostgreSQL扩展
WITH (ODS= FALSE)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.