Patch against v0.11005 attached.

Andrew

Index: lib/SQL/Translator/Parser/DBI/PostgreSQL.pm
===================================================================
--- lib/SQL/Translator/Parser/DBI/PostgreSQL.pm	(revision 919)
+++ lib/SQL/Translator/Parser/DBI/PostgreSQL.pm	(working copy)
@@ -55,8 +55,9 @@
     my $schema = $tr->schema;
 
     my $column_select = $dbh->prepare(
-      "SELECT a.attname, t.typname, a.attnum,a.atttypmod as length,
-              a.attnotnull, a.atthasdef, d.adsrc, description
+      "SELECT a.attname, format_type(t.oid, a.atttypmod) as typname, a.attnum,
+              a.atttypmod as length, a.attnotnull, a.atthasdef, d.adsrc,
+              description
        FROM pg_type t,pg_attribute a
        LEFT JOIN pg_attrdef d ON (d.adrelid = a.attrelid AND a.attnum = d.adnum)
        LEFT JOIN pg_description ON (a.attrelid=objoid AND a.attnum=objsubid)
@@ -148,7 +149,8 @@
                               order       => $$columnhash{'attnum'},
                              ) || die $table->error;
 
-            $col->{size} = [$$columnhash{'length'}] if $$columnhash{'length'}>0;
+            $col->{size} = [$$columnhash{'length'}]
+                if $$columnhash{'length'}>0 && $$columnhash{'length'}<=0xFFFF;
             $col->{is_nullable} = $$columnhash{'attnotnull'} ? 0 : 1;
             $col->{comments} = [$$columnhash{'description'}]
                 if $$columnhash{'description'};

------------------------------------------------------------------------------

-- 
sqlfairy-developers mailing list
sqlfairy-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlfairy-developers

Reply via email to