my $col_numeric_scale = $column_array->[5];
my $col_udt_schema = $column_array->[6];
my $col_udt_name = $column_array->[7];
+ my $col_character_maximum_length = $column_array->[8];
if (defined $col_default && $col_default =~ /::text/) {
$col_default =~ s/^'(.*)'::text$/$1/;
if ($col_type eq 'USER-DEFINED' && defined $col_udt_schema) {
$col_type = "$col_udt_schema.$col_udt_name";
}
+ if ($col_type eq 'character' && defined $col_character_maximum_length) {
+ $col_type .= "($col_character_maximum_length)";
+ }
+
print "\n-- -- -- column " . $dbh->quote("$schema.$table.$column") . "\n\n";
print "SELECT has_column(\n";
print "\t" . $dbh->quote($schema) . ",\n";
numeric_precision,
numeric_scale,
udt_schema,
- udt_name
+ udt_name,
+ character_maximum_length
FROM information_schema.columns
WHERE table_catalog = ?
AND table_schema = ?