From: John Napiorkowski Date: Sun, 12 Apr 2020 11:52:59 +0000 (-0500) Subject: pg_attrdef.adsrc no longer on Pg12+ X-Git-Tag: v1.62~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1438295aa4383725d3edcae6c5e06a29a6dd64a7;p=dbsrgits%2FSQL-Translator.git pg_attrdef.adsrc no longer on Pg12+ pg_get_expr() is available back to Pg7.4 at least --- diff --git a/Changes b/Changes index 766379e..4ff5f7c 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,7 @@ Changes for SQL::Translator + * Update Pg support to allow version 12 (still supporting back to 7.4) + 1.61 - 2020-04-19 * Fixes for Sybase producer * Support CHECK (expr) for SQLite and MySQLoids diff --git a/lib/SQL/Translator/Parser/DBI/PostgreSQL.pm b/lib/SQL/Translator/Parser/DBI/PostgreSQL.pm index b08be12..54949cd 100644 --- a/lib/SQL/Translator/Parser/DBI/PostgreSQL.pm +++ b/lib/SQL/Translator/Parser/DBI/PostgreSQL.pm @@ -38,7 +38,7 @@ sub parse { my $column_select = $dbh->prepare( "SELECT a.attname, format_type(t.oid, a.atttypmod) as typname, a.attnum, - a.atttypmod as length, a.attnotnull, a.atthasdef, ad.adsrc, + a.atttypmod as length, a.attnotnull, a.atthasdef, pg_get_expr(ad.adbin, ad.adrelid) as adsrc, d.description FROM pg_type t, pg_attribute a LEFT JOIN pg_attrdef ad ON (ad.adrelid = a.attrelid AND a.attnum = ad.adnum)