Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WWVfq-0000Tw-Nj for pgsql-odbc@arkaria.postgresql.org; Sat, 05 Apr 2014 18:50:38 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WWVfp-0005Ti-FL for pgsql-odbc@arkaria.postgresql.org; Sat, 05 Apr 2014 18:50:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WWVfn-0005TZ-LS for pgsql-odbc@postgresql.org; Sat, 05 Apr 2014 18:50:35 +0000 Received: from [85.17.249.89] (helo=free.hostodon.me) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WWVfg-0003Ib-JU for pgsql-odbc@postgresql.org; Sat, 05 Apr 2014 18:50:34 +0000 Received: from anonymou by free.hostodon.me with local (Exim 4.82) (envelope-from ) id 1WWVfe-0001TR-3o for pgsql-odbc@postgresql.org; Sat, 05 Apr 2014 20:50:26 +0200 To: pgsql-odbc@postgresql.org Subject: Postgresql ODBC Truncates Timestamp second fractions MIME-Version: 1.0 Content-Type: text/html; charset="utf-8" From: pg_gg@mailinator.com Reply-To: Subject: Postgresql ODBC Truncates Timestamp second fractions X-Mailer: Anonymous Email - http://anonymousemail.us Message-Id: Date: Sat, 05 Apr 2014 20:50:26 +0200 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - free.hostodon.me X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [511 510] / [47 12] X-AntiAbuse: Sender Address Domain - free.hostodon.me X-Get-Message-Sender-Via: free.hostodon.me: authenticated_id: anonymou/only user confirmed/virtual account not confirmed X-Host-Lookup-Failed: Reverse DNS lookup failed for 85.17.249.89 (failed) X-Pg-Spam-Score: 4.9 (++++) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-odbc Precedence: bulk Sender: pgsql-odbc-owner@postgresql.org

Hi

We are trying to replicate data from an Oracle database to PG 9.3 (tried 9.2 as well, but that doesn't really make a difference) on Windows 2008R2 64-bit using Oracle GoldenGate (OGG), but running into an issue with the ODBC driver psqlodbc-09.03.0210. The problem is that timestamp values coming from Oracle are truncated and mili and micro second data is lost. For example if data is '2014-04-05 11:12:13.123456000' what is insertedin the PG table is '2014-04-05 11:12:13', even when the field is defined as timestamp or timestamp (6). We logged the queries and it appears that the parameter that is prepared is already truncated to seconds only. We only see this behaviour with OGG, and not through other methods of inserting data using the same ODBC connection. However, the ODBC driver that ships with OGG, which is from DataDirect, doesn't have this problem and passes the timestamp values appropriately. However we cannot use that driver, as it doesn't handle unicode null character, i.e. 0x00, which the official PG ODBC driver somehow handles. So basically none of the drivers work properly, but each has it's own separate issue. We are trying to figure out where in the psqlodbc codes the preparation and conversion of parameters happen to find out why the timestamp values are truncated if the data is coming from OGG and not truncated from other mechansims. Any help with this regard is greatly appreciated.

Thank you
A.