Fix default numeric precision.
authorDave Page <dpage@pgadmin.org>
Fri, 5 Aug 2005 12:19:48 +0000 (12:19 +0000)
committerDave Page <dpage@pgadmin.org>
Fri, 5 Aug 2005 12:19:48 +0000 (12:19 +0000)
connection.c

index e4b05ce6a7c818db813e8a22b2bccf9d60c24c6b..2cb06b08b3ce86e3c1bf8a8f532b650b1958cd9e 100644 (file)
@@ -3239,7 +3239,12 @@ CC_mapping(PGresult *pgres,QResultClass *qres)
    {
        typid = PQftype(pgres,i);
        atttypmod = PQfmod(pgres,i);
-       typlen = PQfsize(pgres,i);
+\r
+        if (PG_TYPE_NUMERIC == typid)\r
+            typlen = ((atttypmod - 4)  >> 16) & 0xffff;\r
+        else\r
+            typlen = PQfsize(pgres,i);\r
+        
        if(typlen == -1 || PG_TYPE_VARCHAR == typid)
            typlen = MAX_VARCHAR_SIZE;
        switch (typid)