Skip to content

sql: current_schema should skip over invalid schemas #24472

@wzrdtales

Description

@wzrdtales

BUG REPORT

For cockroachdb 2.0.0 the node driver fails to create a table for unknown reasons when using it with db-migrate:

[ERROR] error: invalid target name: "migrations"
    at Connection.parseE (/home/node/node_modules/pg/lib/connection.js:545:11)
    at Connection.parseMessage (/home/node/node_modules/pg/lib/connection.js:370:19)
    at Socket.<anonymous> (/home/node/node_modules/pg/lib/connection.js:113:22)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at Socket.Readable.push (_stream_readable.js:208:10)
    at TCP.onread (net.js:607:20)

If you execute the same query by hand, it does work for unknown reasons:

CREATE TABLE IF NOT EXISTS "migrations" ("id"   SERIAL PRIMARY KEY NOT NULL, "name" VARCHAR (255) NOT NULL, "run_on" TIMESTAMP  NOT NULL) 

On my side everything is patched now:

db-migrate/cockroachdb@ce29dca

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions