diff --git a/cmd/db_to_db.go b/cmd/db_to_db.go index eb70ea8..56d3bbd 100644 --- a/cmd/db_to_db.go +++ b/cmd/db_to_db.go @@ -80,7 +80,7 @@ func LocalDatabaseSync( } psql_write := pipes.Psql( - pipes.PG_Dump_Table(source_db_creds, schema, table), + pipes.PG_Dump_Table(source_db_creds, schema, table, "--format plain"), dest_db_creds, ) psql_write.Wait() @@ -118,7 +118,7 @@ func CgovDatabaseSync( } psql_write := pipes.Psql( - pipes.PG_Dump_Table(source_db_creds, schema, table), + pipes.PG_Dump_Table(source_db_creds, schema, table, "--format plain"), dest_db_creds, ) psql_write.Wait() diff --git a/cmd/db_to_s3.go b/cmd/db_to_s3.go index ab1ce18..210f068 100644 --- a/cmd/db_to_s3.go +++ b/cmd/db_to_s3.go @@ -77,7 +77,7 @@ func tables_to_local_bucket( // 2. When there are no names in the list (backup all). if slices.Contains(table_names, table) || BACKUP_ALL { mc_pipe := pipes.McWrite( - pipes.PG_Dump_Table(source_creds, schema, table), + pipes.PG_Dump_Table(source_creds, schema, table, "--format c"), up_creds, fmt.Sprintf("%s%s/%s-%s.dump", s3path.Bucket, s3path.Key, schema, table), ) @@ -102,7 +102,7 @@ func tables_to_cgov_bucket( for table, schema := range table_to_schema { if slices.Contains(table_names, table) || BACKUP_ALL { s3_pipe := pipes.S3Write( - pipes.PG_Dump_Table(source_creds, schema, table), + pipes.PG_Dump_Table(source_creds, schema, table, "--format c"), s3_creds, fmt.Sprintf("%s%s/%s-%s.dump", s3path.Bucket, s3path.Key, schema, table), ) diff --git a/internal/pipes/pg_dump.go b/internal/pipes/pg_dump.go index f27ef8f..d80e93c 100644 --- a/internal/pipes/pg_dump.go +++ b/internal/pipes/pg_dump.go @@ -12,14 +12,15 @@ import ( func PG_Dump_Table(creds vcap.Credentials, schema string, - table string) *script.Pipe { + table string, + format string) *script.Pipe { // Compose the command as a slice cmd := []string{ util.PGDUMP_path, "--no-password", "--no-privileges", "--no-owner", - "--format c", + format, // need plain for db_to_db "--table", fmt.Sprintf("%s.%s", schema, table), "--dbname",