-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql: support pg_dump #20296
Copy link
Copy link
Open
Labels
A-sql-pgcompatSemantic compatibility with PostgreSQLSemantic compatibility with PostgreSQLA-tools-pgdumpIssues relating to pg_dump compatibilityIssues relating to pg_dump compatibilityC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)O-communityOriginated from the communityOriginated from the communityT-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)SQL Foundations Team (formerly SQL Schema + SQL Sessions)meta-issueContains a list of several other issues.Contains a list of several other issues.
Description
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-sql-pgcompatSemantic compatibility with PostgreSQLSemantic compatibility with PostgreSQLA-tools-pgdumpIssues relating to pg_dump compatibilityIssues relating to pg_dump compatibilityC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)O-communityOriginated from the communityOriginated from the communityT-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)SQL Foundations Team (formerly SQL Schema + SQL Sessions)meta-issueContains a list of several other issues.Contains a list of several other issues.