projects
/
DBIx-DBSchema.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix Pg reverse-engineering of default values in Pg v12+
[DBIx-DBSchema.git]
/
DBSchema
/
DBD
/
Pg.pm
diff --git
a/DBSchema/DBD/Pg.pm
b/DBSchema/DBD/Pg.pm
index
d76e446
..
4651254
100644
(file)
--- 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;
use strict;
use DBD::Pg 1.41;
-our $VERSION = '0.2
0
';
+our $VERSION = '0.2
1
';
our %typemap = (
'BLOB' => 'BYTEA',
our %typemap = (
'BLOB' => 'BYTEA',
@@
-62,7
+62,7
@@
END
if ( $_->{atthasdef} ) {
my $attnum = $_->{attnum};
my $d_sth = $dbh->prepare(<<END) or die $dbh->errstr;
if ( $_->{atthasdef} ) {
my $attnum = $_->{attnum};
my $d_sth = $dbh->prepare(<<END) or die $dbh->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;
WHERE c.relname = '$table' AND c.oid = d.adrelid AND d.adnum = $attnum
END
$d_sth->execute or die $d_sth->errstr;