Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1elI9e-0000Vj-S5 for pgsql-odbc@arkaria.postgresql.org; Mon, 12 Feb 2018 17:44:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1elI9d-0000Rr-1q for pgsql-odbc@arkaria.postgresql.org; Mon, 12 Feb 2018 17:44:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1elI9c-0000Ri-St for pgsql-odbc@lists.postgresql.org; Mon, 12 Feb 2018 17:44:36 +0000 Received: from mx1.hrz.uni-dortmund.de ([129.217.128.51] helo=unimail.uni-dortmund.de) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1elI9Z-0004Fy-V2 for pgsql-odbc@lists.postgresql.org; Mon, 12 Feb 2018 17:44:36 +0000 Received: from webmail.tu-dortmund.de (vmx028.itmc.tu-dortmund.de [129.217.131.82]) (authenticated bits=0) by unimail.uni-dortmund.de (8.16.0.21/8.16.0.21) with ESMTPSA id w1CHiWJc003785 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 12 Feb 2018 18:44:32 +0100 (CET) Received: from 77.181.198.234 (SquirrelMail authenticated user smtswend) by webmail.tu-dortmund.de with HTTP; Mon, 12 Feb 2018 18:44:32 +0100 Message-ID: <6a37a7d4372deee3354e08983104ad81.squirrel@webmail.tu-dortmund.de> Date: Mon, 12 Feb 2018 18:44:32 +0100 Subject: NUMERIC type makes trouble in MS Access From: "Tobias Wendorff" To: pgsql-odbc@lists.postgresql.org User-Agent: SquirrelMail/1.4.23 [SVN] MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi there, I'm experiencing problems with the ODBC driver on Windows 7 (and 10) on 32 and 64 bit in Microsoft Access 2003, 2010 and 2016 (32, 64 bit). My PostgreSQL server runs on Debian (64-bit): 9.6.7-1.pgdg80+1 Tested ODBC drivers: psqlodbc_09_06_0500 & psqlodbc_10_01_0000 Summary of the problem: The current behavior of the ODBC driver creates an error in Access, since the incoming values are longer than the field type. This leads into a truncation warning (with many messageboxes) and no values are shown at all. The expected behavior is either TEXT (bad) or DOUBLE (without any precision details). Documentation: As stated in the docs, I've played with the setting "Unknown Sizes"; they don't help, but give me a different result: - "Maximum" & "Longest" behave equal (see blow) - "Don't Know" creates an error in Access (types can't be identified) Deeper analyis: 1. column type NUMERIC (without further specification) PostgreSQL's ODBC driver: - field type: decimal - precision: 28 - decimal places: 6 - decimal places display: automatic => I'm getting the truncation warning, no values shown (only errors). commercial ODBC driver: - field type: double - decimal places display: automatic => Display works as expected. 2. column type NUMERIC (40, 32) PostgreSQL's ODBC driver: - field type: text - length: 40 => All values shown with trailing zeros and it's a string. commercial ODBC driver: => same behaviour 3. column type NUMERIC (26, 18) PostgreSQL's ODBC driver: - field type: decimal - precision: 26 - decimal places: 18 - decimal places display: automatic => As expected, truncation to '12345.012345678901234568'. Lossy workaround: A view, which casts NUMERIC to FLOAT. Could anyone have a look please? Best regards, Tobias Tested with this syntax: DROP TABLE IF EXISTS demo; CREATE TABLE DEMO (v numeric); INSERT INTO demo VALUES (1.0); INSERT INTO demo VALUES (1.0123456789); INSERT INTO demo VALUES (1.01234567890123456789); INSERT INTO demo VALUES (12345.012345678901234567890123456789); ALTER TABLE demo ALTER COLUMN v TYPE numeric(40,35); ALTER TABLE demo ALTER COLUMN v TYPE numeric(26,18);