From: Nick Wellnhofer Date: Mon, 27 Oct 2014 13:26:21 +0000 (+0000) Subject: Fix erroneous PostgreSQL floating point type translations (RT#99725) X-Git-Tag: v0.11021~13 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=90089d638fc1c611a3c23651edb096546c19f38f;p=dbsrgits%2FSQL-Translator.git Fix erroneous PostgreSQL floating point type translations (RT#99725) --- diff --git a/AUTHORS b/AUTHORS index a7cc17d..859f092 100644 --- a/AUTHORS +++ b/AUTHORS @@ -42,6 +42,7 @@ The following people have contributed to the SQLFairy project: - Michal Jurosz - Mikey Melillo - Moritz Onken +- Nick Wellnhofer - Paul Harrington - Peter Rabbitson - Robert Bohne diff --git a/Changes b/Changes index 74d9fd8..d298b50 100644 --- a/Changes +++ b/Changes @@ -9,6 +9,7 @@ Changes for SQL::Translator Oracle (RT#90700, RT#31034) * Add support for ALTER TABLE ... ADD CONSTRAINT to Oracle parser * Add trigger support to Oracle parser (RT#62927) + * Fix erroneous PostgreSQL floating point type translations (RT#99725) 0.11020 2014-09-02 diff --git a/lib/SQL/Translator/Producer/PostgreSQL.pm b/lib/SQL/Translator/Producer/PostgreSQL.pm index 4fffce3..4df18bf 100644 --- a/lib/SQL/Translator/Producer/PostgreSQL.pm +++ b/lib/SQL/Translator/Producer/PostgreSQL.pm @@ -55,9 +55,8 @@ BEGIN { # MySQL types # bigint => 'bigint', - double => 'numeric', + double => 'double precision', decimal => 'numeric', - float => 'numeric', int => 'integer', mediumint => 'integer', smallint => 'smallint', @@ -98,11 +97,9 @@ BEGIN { varchar => 'character varying', datetime => 'timestamp', text => 'text', - real => 'numeric', comment => 'text', bit => 'bit', tinyint => 'smallint', - float => 'numeric', ); $max_id_length = 62; @@ -718,7 +715,7 @@ sub convert_datatype my $type_with_size = join('|', 'bit', 'varbit', 'character', 'bit varying', 'character varying', - 'time', 'timestamp', 'interval', 'numeric' + 'time', 'timestamp', 'interval', 'numeric', 'float' ); if ( $data_type !~ /$type_with_size/ ) {