From 44a04e00794abd9ac1bc5cfd8538a20a8f981c07 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Wed, 7 Sep 2022 16:32:57 -0700 Subject: [PATCH] Fix Pg reverse-engineering of default values in Pg v12+ --- Changes | 5 ++++- DBSchema.pm | 2 +- DBSchema/DBD/Pg.pm | 4 ++-- debian/changelog | 6 ++++++ 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Changes b/Changes index e16d098..a416eef 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,9 @@ Revision history for Perl module DBIx::DBSchema -0.46 unreleased +0.47 unreleased + - Fix Pg reverse-engineering of default values in Pg v12+ + +0.46 unreleased (2016) - Add IF EXISTS to DROP INDEX (except under MySQL) - Fix table fetching for Sybase and SQLite drivers; refactor table fetching into a driver-overridable DBIx::DBSchema::DBD->tables method, patches diff --git a/DBSchema.pm b/DBSchema.pm index afd0310..89354cd 100644 --- a/DBSchema.pm +++ b/DBSchema.pm @@ -8,7 +8,7 @@ use DBIx::DBSchema::Index; use DBIx::DBSchema::Column; use DBIx::DBSchema::ForeignKey; -our $VERSION = '0.46_03'; +our $VERSION = '0.47'; $VERSION = eval $VERSION; # modperlstyle: convert the string into a number our $DEBUG = 0; diff --git a/DBSchema/DBD/Pg.pm b/DBSchema/DBD/Pg.pm index d76e446..4651254 100644 --- a/DBSchema/DBD/Pg.pm +++ b/DBSchema/DBD/Pg.pm @@ -4,7 +4,7 @@ use base qw(DBIx::DBSchema::DBD); use strict; use DBD::Pg 1.41; -our $VERSION = '0.20'; +our $VERSION = '0.21'; our %typemap = ( 'BLOB' => 'BYTEA', @@ -62,7 +62,7 @@ END if ( $_->{atthasdef} ) { my $attnum = $_->{attnum}; my $d_sth = $dbh->prepare(<errstr; - SELECT substring(d.adsrc for 128) FROM pg_attrdef d, pg_class c + SELECT pg_get_expr(d.adbin, d.adrelid) FROM pg_attrdef d, pg_class c WHERE c.relname = '$table' AND c.oid = d.adrelid AND d.adnum = $attnum END $d_sth->execute or die $d_sth->errstr; diff --git a/debian/changelog b/debian/changelog index da4459d..ceffae8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +libdbix-dbschema-perl (0.47-1) UNRELEASED; urgency=medium + + * new upstream release + + -- Ivan Kohler Wed, 07 Sep 2022 16:30:37 -0700 + libdbix-dbschema-perl (0.46~02-1) unstable; urgency=medium * new upstream (test) release -- 2.11.0