agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@gmail.com>
To: Sandeep Devan <sdevan@in.rm.com>
To: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
Subject: Re: "Timestamp out of range"
Date: Thu, 30 Jan 2014 07:25:23 -0800
Message-ID: <52EA6EE3.5060108@gmail.com> (raw)
In-Reply-To: <8c7644832d5a4861bd567bbabf2b2f29@AMSPR04MB211.eurprd04.prod.outlook.com>
References: <8c7644832d5a4861bd567bbabf2b2f29@AMSPR04MB211.eurprd04.prod.outlook.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-sql>

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



view thread (2+ messages)

Message-ID: <52EA6EE3.5060108@gmail.com>
Permalink:  ../52EA6EE3.5060108@gmail.com/
Also on:    postgresql.org/message-id/52EA6EE3.5060108@gmail.com

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: adrian.klaver@gmail.com, sdevan@in.rm.com
  Subject: Re: "Timestamp out of range"
  In-Reply-To: <52EA6EE3.5060108@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox