Subject: | pg_dump bug for PostgreSQL v9.3.22+ |
Date: | Wed, 15 Aug 2018 16:04:16 -0400 |
To: | bug-Module-Build-Database [...] rt.cpan.org |
From: | "Kathryn Tipton (Contractor)" <ktipton [...] usgcrp.gov> |
Hello,
PostgreSQL changed the way pg_dump handles the search_path in version
9.3.22, making it default to unset in the dumped sql. This isn't a problem
if the tables have fully qualified table names with their schema. Currently
Module::Build::Database::PostgreSQL trims off the schema component for some
parts of the export at line 420:
https://metacpan.org/source/BDUGGAN/Module-Build-Database-0.57/lib/Module/Build/Database/PostgreSQL.pm#L420
Would it be possible to remove that trimming?
Thank you.
Example Patch:
diff --git a/PostgreSQL.pm b/PostgreSQL.pm
index 02f75fe..0ef1d12 100644
--- a/PostgreSQL.pm
+++ b/PostgreSQL.pm
@@ -417,9 +417,6 @@ sub _dump_base_sql {
and $_ !~ /^CREATE SCHEMA $database_schema;$/
and $_ !~ /^SET (search_path|lock_timeout)/
} @lines;
- for (@lines) {
- /alter table/i and s/$database_schema\.//;
- }
file($outfile)->spew(join '', @lines);
if (@lines > 0 && !-s $outfile) {
die "# Unable to write to $outfile";
--
Kat