Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WITH (OIDS=FALSE) fails on CockroachDB #1540

Closed
sachin-walia opened this issue Feb 24, 2017 · 1 comment
Closed

WITH (OIDS=FALSE) fails on CockroachDB #1540

sachin-walia opened this issue Feb 24, 2017 · 1 comment

Comments

@sachin-walia
Copy link

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
)

@axelfontaine axelfontaine added this to the Flyway 4.1.2 milestone Feb 24, 2017
@axelfontaine
Copy link
Contributor

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 axelfontaine changed the title Support for CockroachDB WITH (OIDS=FALSE) fails on CockroachDB Feb 24, 2017
axelfontaine pushed a commit to flyway/flywaydb.org that referenced this issue Mar 3, 2017
dohrayme pushed a commit to dohrayme/flyway that referenced this issue Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants