You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SQL State : XX000
Error Code : 0
Message : ERROR: syntax error at or near "WITH"
CREATE TABLE "mydb"."schema_version" (
"installed_rank" INT NOT NULL,
"version" VARCHAR(50),
"description" VARCHAR(200) NOT NULL,
"type" VARCHAR(20) NOT NULL,
"script" VARCHAR(1000) NOT NULL,
"checksum" INTEGER,
"installed_by" VARCHAR(100) NOT NULL,
"installed_on" TIMESTAMP NOT NULL DEFAULT now(),
"execution_time" INTEGER NOT NULL,
"success" BOOLEAN NOT NULL
) WITH (
^
Line : 17
Statement : CREATE TABLE "mydb"."schema_version" (
"installed_rank" INT NOT NULL,
"version" VARCHAR(50),
"description" VARCHAR(200) NOT NULL,
"type" VARCHAR(20) NOT NULL,
"script" VARCHAR(1000) NOT NULL,
"checksum" INTEGER,
"installed_by" VARCHAR(100) NOT NULL,
"installed_on" TIMESTAMP NOT NULL DEFAULT now(),
"execution_time" INTEGER NOT NULL,
"success" BOOLEAN NOT NULL
) WITH (
OIDS=FALSE
)
The text was updated successfully, but these errors were encountered:
Since WITH (OIDS=FALSE) has been the default since PostgreSQL 8.1 (see https://www.postgresql.org/docs/current/static/runtime-config-compatible.html). It is probably safe to remove that. I am changing the issue scope to this. Please re-open a new issue if new problems arise beyond this fix. Additionally you may probably want to open an issue with CockroachDB to at the very least get them to ignore this instead of failing as this is a clear incompatibility compared to plain PostgreSQL.
axelfontaine
changed the title
Support for CockroachDB
WITH (OIDS=FALSE) fails on CockroachDB
Feb 24, 2017
What version of Flyway are you using?
4.1.1
Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin, SBT plugin, ANT tasks)
Command-line
What database are you using (type & version)?
CockroachDB (https://www.cockroachlabs.com/docs/build-an-app-with-cockroachdb.html)
What operating system are you using?
Ubuntu Linux
What did you do?
(Please include the content causing the issue, any relevant configuration settings, and the command you ran)
Executing baseline, migrate command fails
What did you expect to see?
Since cockroachDB is wire level compatible with Postgresql so it should be successful barring any DB level grammar support
What did you see instead?
Following exception:
Flyway 4.0 by Boxfuse
Database: jdbc:postgresql://localhost:26257/mydb (PostgreSQL 9.5)
Creating Metadata table: "mydb"."schema_version"
ERROR:
Script failed
SQL State : XX000
Error Code : 0
Message : ERROR: syntax error at or near "WITH"
CREATE TABLE "mydb"."schema_version" (
"installed_rank" INT NOT NULL,
"version" VARCHAR(50),
"description" VARCHAR(200) NOT NULL,
"type" VARCHAR(20) NOT NULL,
"script" VARCHAR(1000) NOT NULL,
"checksum" INTEGER,
"installed_by" VARCHAR(100) NOT NULL,
"installed_on" TIMESTAMP NOT NULL DEFAULT now(),
"execution_time" INTEGER NOT NULL,
"success" BOOLEAN NOT NULL
) WITH (
^
Line : 17
Statement : CREATE TABLE "mydb"."schema_version" (
"installed_rank" INT NOT NULL,
"version" VARCHAR(50),
"description" VARCHAR(200) NOT NULL,
"type" VARCHAR(20) NOT NULL,
"script" VARCHAR(1000) NOT NULL,
"checksum" INTEGER,
"installed_by" VARCHAR(100) NOT NULL,
"installed_on" TIMESTAMP NOT NULL DEFAULT now(),
"execution_time" INTEGER NOT NULL,
"success" BOOLEAN NOT NULL
) WITH (
OIDS=FALSE
)
The text was updated successfully, but these errors were encountered: