From: Ken Youens-Clark Date: Wed, 11 Aug 2004 22:00:39 +0000 (+0000) Subject: Take the defined field size if present. X-Git-Tag: v0.06~15 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=44ffdb73cb42c65f11e6f1d005255fba30588fe3;p=dbsrgits%2FSQL-Translator.git Take the defined field size if present. --- diff --git a/lib/SQL/Translator/Parser/PostgreSQL.pm b/lib/SQL/Translator/Parser/PostgreSQL.pm index 72f8ff0..47736c3 100644 --- a/lib/SQL/Translator/Parser/PostgreSQL.pm +++ b/lib/SQL/Translator/Parser/PostgreSQL.pm @@ -1,7 +1,7 @@ package SQL::Translator::Parser::PostgreSQL; # ------------------------------------------------------------------- -# $Id: PostgreSQL.pm,v 1.38 2004-03-01 17:39:22 kycl4rk Exp $ +# $Id: PostgreSQL.pm,v 1.39 2004-08-11 22:00:39 kycl4rk Exp $ # ------------------------------------------------------------------- # Copyright (C) 2002-4 SQLFairy Authors # @@ -108,7 +108,7 @@ View table: use strict; use vars qw[ $DEBUG $VERSION $GRAMMAR @EXPORT_OK ]; -$VERSION = sprintf "%d.%02d", q$Revision: 1.38 $ =~ /(\d+)\.(\d+)/; +$VERSION = sprintf "%d.%02d", q$Revision: 1.39 $ =~ /(\d+)\.(\d+)/; $DEBUG = 0 unless defined $DEBUG; use Data::Dumper; @@ -407,7 +407,9 @@ data_type : pg_data_type parens_value_list(?) # # We can deduce some sizes from the data type's name. # - $data_type->{'size'} ||= $item[2][0]; + if ( my $size = $item[2][0] ) { + $data_type->{'size'} = $size; + } $return = $data_type; }