From f9543de627b93964dd8c4ef3a864e0e08ad64425 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Sun, 20 Aug 2006 18:19:50 +0000 Subject: [PATCH] Since PostgreSQL 7.4 the precision given for float columsn is the number of bits to use, and not the number of decimals. So, based on the number of decimals from the XMLDB schema, we are going to create REAL (<6 decimals) or DOUBLE PRECISION (>=6) columns. --- .../classes/generators/postgres7/postgres7.class.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/xmldb/classes/generators/postgres7/postgres7.class.php b/lib/xmldb/classes/generators/postgres7/postgres7.class.php index 61f22b8a80..6a48e5461a 100644 --- a/lib/xmldb/classes/generators/postgres7/postgres7.class.php +++ b/lib/xmldb/classes/generators/postgres7/postgres7.class.php @@ -87,13 +87,11 @@ class XMLDBpostgres7 extends XMLDBgenerator { } break; case XMLDB_TYPE_FLOAT: - $dbtype = 'REAL'; - if (!empty($xmldb_length)) { - $dbtype .= '(' . $xmldb_length; - if (!empty($xmldb_decimals)) { - $dbtype .= ',' . $xmldb_decimals; + $dbtype = 'DOUBLE PRECISION'; + if (!empty($xmldb_decimals)) { + if ($xmldb_decimals < 6) { + $dbtype = 'REAL'; } - $dbtype .= ')'; } break; case XMLDB_TYPE_CHAR: -- 2.39.5