Subject: | SQL::Translator::Producer::PostgreSQL not recognising precision and scale on numeric type |
SQL::Translator::Producer::PostgreSQL version 1.59 included with
SQL::Translator version 0.11002
When creating a postgresql table such as
CREATE TABLE foo (
id integer PRIMARY KEY
numeric_foo numeric(8,1)
);
The (8,1) precision and scale are being ignored and the following
table is being created:
CREATE TABLE foo (
id integer PRIMARY KEY
numeric_foo numeric
);
Changing the join at line 703 in the convert_datatype function:
my $type_with_size = join('|',
'bit', 'varbit', 'character', 'bit varying', 'character varying',
'time', 'timestamp', 'interval',
);
to include the numeric type
my $type_with_size = join('|',
'bit', 'varbit', 'character', 'bit varying', 'character varying',
'time', 'timestamp', 'interval', 'numeric'
);
fixes this.
The SQL::Translator::Producer::PostgreSQL version 1.59 that was
included with SQL::Translator version 0.09004 did not have this
problem as the types without size were listed. This was changed
in SQL::Translator version 0.11000.