Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WWW6e-0001Pb-16 for pgsql-odbc@arkaria.postgresql.org; Sat, 05 Apr 2014 19:18:20 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WWW6d-0006ls-FR for pgsql-odbc@arkaria.postgresql.org; Sat, 05 Apr 2014 19:18:19 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WWW6b-0006jr-Mj for pgsql-odbc@postgresql.org; Sat, 05 Apr 2014 19:18:18 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WWW6Y-0001jS-DO for pgsql-odbc@postgresql.org; Sat, 05 Apr 2014 19:18:16 +0000 Received: from compute4.internal (compute4.nyi.mail.srv.osa [10.202.2.44]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id B846720D95; Sat, 5 Apr 2014 15:18:12 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute4.internal (MEProxy); Sat, 05 Apr 2014 15:18:12 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=aklaver.com; h= message-id:date:from:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; s=mesmtp; bh=3WjwSkhzUJJQYqg4W3f1lLeHQwA=; b=FoHDhymu38KZNgTuugezxDYZlvbS 9Hggmoip4fGWu3MNA2XcHxpZFqWELvsqt8R1V0ejgQgPMnxvDH++dxyRSXvMPran k47wgFiGTLjE4QHr6rGY5yJIK/XHJjGuLjz32z9UzFnWVDGktNqR3pAZ2A7Yus+6 htYRqPzeAXEiQkw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:date:from:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; s=smtpout; bh=3WjwSkhzUJJQYqg4W3f1lL eHQwA=; b=enj2fo6L3v+gbbfcEMED+twwhPCJInAAaaVWbfs9ZrwkT3sv9T5i5z n5b5vbMMloxPb27Ljyzc+ZSu2ZzptPVMsr+RWAWKTe11uOCyhYCshwFzrDml58t9 AbWnNgQBx7QqWi99HRmcBRQKzE7bbaxXkS7UuSpUGJ/KWeD0Zc6Fc= X-Sasl-enc: NTeY/9e+RA7PibeXF430hAqChHDq19VYIU1Zf9YUt5Qy 1396725492 Received: from panda.site (unknown [97.113.11.16]) by mail.messagingengine.com (Postfix) with ESMTPA id 34857680161; Sat, 5 Apr 2014 15:18:12 -0400 (EDT) Message-ID: <534056F3.506@aklaver.com> Date: Sat, 05 Apr 2014 12:18:11 -0700 From: Adrian Klaver User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: pg_gg@mailinator.com, pgsql-odbc@postgresql.org Subject: Re: Postgresql ODBC Truncates Timestamp second fractions References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.7 (--) 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 On 04/05/2014 11:50 AM, pg_gg@mailinator.com wrote: > 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. Would seem this is coming from the Oracle side of things, given that you say psqlodbc does the right thing when not receiving data from OGC. Also that the parameter is already truncated. That indicates to me the Oracle conversion is doing the pruning before passing it to psqlodbc. My guess is the DataDirect driver is using a setting to do the right thing. Confirmed I believe by this: http://knowledgebase.datadirect.com/articles/Article/8788 > > Thank you > A. > -- Adrian Klaver adrian.klaver@aklaver.com -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc