Simple change to make Postgres simple array types produce correctly
[dbsrgits/SQL-Translator.git] / lib / SQL / Translator / Producer / PostgreSQL.pm
index 02c9f11..4b883c7 100644 (file)
@@ -674,6 +674,7 @@ sub convert_datatype
 
     my @size      = $field->size;
     my $data_type = lc $field->data_type;
+    my $array = $data_type =~ s/\[\]$//;
 
     if ( $data_type eq 'enum' ) {
 #        my $len = 0;
@@ -740,6 +741,10 @@ sub convert_datatype
     } elsif ( defined $size[0] && $size[0] > 0 ) {
         $data_type .= '(' . join( ',', @size ) . ')';
     }
+    if($array)
+    {
+        $data_type .= '[]';
+    }
 
     #
     # Geography