Skip to content

sql: support pg_dump #20296

@donpdonp

Description

@donpdonp

FEATURE REQUEST

One big plus for trying cockroachdb was its compatibilty with postgres. I assumed pg_dump would work, instead it errors out.

$ pg_dump -h db1 -p 26257 database
pg_dump: [archiver (db)] query failed: ERROR:  unknown function: pg_catalog.pg_is_in_recovery()
pg_dump: [archiver (db)] query was: SELECT pg_catalog.pg_is_in_recovery()

I've also tried 'cockroachdb dump > out.sql' but the SQL is not postgres compatible. id STRING(128) for example. I hand edited the schema to try and get this route to work, but loading the data itself hits schema constraints since a foreign key field means table B must come before table A, but the sql dump file loads table A then B. pg_restore is supposed to have a work-around for this, which is why I'd like to have pg_dump work.

I belive pg_is_in_recovery is relatively new for postgres, so perhaps this only recently stopped working.

Jira issue: CRDB-5936

Epic CRDB-28751

Metadata

Metadata

Assignees

Labels

A-sql-pgcompatSemantic compatibility with PostgreSQLA-tools-pgdumpIssues relating to pg_dump compatibilityC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)O-communityOriginated from the communityT-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)meta-issueContains a list of several other issues.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions