From: Ken Youens-Clark Date: Wed, 12 Aug 2009 21:00:37 +0000 (+0000) Subject: Resolves RT#35448. X-Git-Tag: v0.11008~116 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=52bc2e139267b7477612da703079a41f70639bf3;p=dbsrgits%2FSQL-Translator.git Resolves RT#35448. --- diff --git a/lib/SQL/Translator/Producer/PostgreSQL.pm b/lib/SQL/Translator/Producer/PostgreSQL.pm index cd80f75..c89e6c5 100644 --- a/lib/SQL/Translator/Producer/PostgreSQL.pm +++ b/lib/SQL/Translator/Producer/PostgreSQL.pm @@ -702,13 +702,13 @@ sub convert_datatype $data_type = 'integer'; } } - my @type_without_size = qw/bigint boolean box bytea cidr circle date inet - integer smallint text line lseg macaddr money - path point polygon real/; - foreach (@type_without_size) { - if ( $data_type =~ qr/$_/ ) { - undef @size; last; - } + + my $type_with_size = join('|', + 'bit', 'varbit', 'character', 'bit varying', 'character varying' + ); + + if ( $data_type !~ /$type_with_size/ ) { + @size = (); } if (defined $size[0] && $size[0] > 0 && $data_type =~ /^time/i ) { @@ -717,8 +717,6 @@ sub convert_datatype } elsif ( defined $size[0] && $size[0] > 0 ) { $data_type .= '(' . join( ',', @size ) . ')'; } - - return $data_type; }