Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W8tUi-0000Wq-27 for pgsql-sql@arkaria.postgresql.org; Thu, 30 Jan 2014 15:25:32 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1W8tUh-0001zs-HO for pgsql-sql@arkaria.postgresql.org; Thu, 30 Jan 2014 15:25:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W8tUg-0001ya-1W for pgsql-sql@postgresql.org; Thu, 30 Jan 2014 15:25:30 +0000 Received: from mail-pb0-x234.google.com ([2607:f8b0:400e:c01::234]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W8tUd-0008Sv-2O for pgsql-sql@postgresql.org; Thu, 30 Jan 2014 15:25:29 +0000 Received: by mail-pb0-f52.google.com with SMTP id jt11so3211703pbb.25 for ; Thu, 30 Jan 2014 07:25:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=7pxl12sS3Q7EdqvjvgwVDjun0vy+kcsfIM0uslTIcl0=; b=Nbov0G77+A4C8ZkwUhHB4a+TydUG3gcAqCheAeSA56BygoX921f50z+WLR1zh2yGoA bjP7TCdVlCnQmQkTNZa5Io+rpOCqoTjit+26kRhXrsZ9JfCrQjnGgdzUv/OFIl0vw8YH OKYd1DRMzOsQUE7I/zRYneiDKOMuR5iOo0XmwmBW3rJ0yT6eTHHbwalnFUwfPXTLTNkN 68Hek8r2rH+nf7+Ff2Y4+M/3WFcmQTiDZq+Lsz5ibKRKBvksrON6leIUYQr88RT97Fvp xSotsvRqZBttMpftnH83N0JTyLgqgh8q3hSZPGJdz4D8AVJIvXsIaM7D4S4AOj38uV+5 UHtg== X-Received: by 10.66.155.7 with SMTP id vs7mr14961047pab.42.1391095525199; Thu, 30 Jan 2014 07:25:25 -0800 (PST) Received: from panda.site (65-102-185-39.tukw.qwest.net. [65.102.185.39]) by mx.google.com with ESMTPSA id kk1sm18445261pbd.22.2014.01.30.07.25.23 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 30 Jan 2014 07:25:24 -0800 (PST) Message-ID: <52EA6EE3.5060108@gmail.com> Date: Thu, 30 Jan 2014 07:25:23 -0800 From: Adrian Klaver User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Sandeep Devan , "pgsql-sql@postgresql.org" Subject: Re: "Timestamp out of range" References: <8c7644832d5a4861bd567bbabf2b2f29@AMSPR04MB211.eurprd04.prod.outlook.com> In-Reply-To: <8c7644832d5a4861bd567bbabf2b2f29@AMSPR04MB211.eurprd04.prod.outlook.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org On 01/30/2014 05:41 AM, Sandeep Devan wrote: > Hi, > We have a .Net application which stores data in PostgreSQL. We have a > perfectly working code with PostgreSQL 8.3 and now we are trying to > upgrade our PostgreSQL server from version 8.3 to 9.3 and our code seems > to break. > For connecting PostgeSQL we are using ‘OLEDB’. > The issue we are getting is “Timestamp out of range”. When looked > through the logs receiving weird timestamp “152085-04-28 06:14:51.818821”. > From our application We are trying to pass a value from .Net code to > postgreSQL function which is of type timestamp. As we are using OLEDB > for connections, we are using parameter type as “OleDbType.DBTimeStamp” > and sending date time value from .Net code. This code works in > PostgreSQL 8.3 but breaks in 9.3. From the logs of Postgresql 9.3 the > parameter value which we are receiving is “152085-04-28 06:14:51.818821”. > We tried to execute the same function using ‘npgsql’ provider from > sample .net code by passing Date time value and giving parameter type as > “NpgsqlDbType.TimestampTZ” with this we are getting correct results. > From the logs of PostgreSQL the parameter values received at the > function is shown as “E'2014-01-30 12:17:50.804220'::timestamptz”. > Tried in other versions of postgresql i.e. 9.1, 9.2, 9.3 and was > breaking in all these versions. > Any Idea why this is breaking in other versions of PostgreSQL when > perfectly working in 8.3? A possible clue is that 8.3 was the last version in which the default storage for timestamps was double precision floating point. In subsequent versions the default storage is eight-byte integers. Could be OleDbType.DBTimeStamp and NpgsqlDbType.TimestampTZ differ in this regard. > Thanks, > Sandeep -- Adrian Klaver adrian.klaver@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql