Adding 3 hours while inserting data into table

From: M Tarkeshwar Rao <m(dot)tarkeshwar(dot)rao(at)ericsson(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Cc: Gaurav Tiwari G <gaurav(dot)g(dot)tiwari(at)ericsson(dot)com>
Subject: Adding 3 hours while inserting data into table
Date: 2014-08-06 10:50:21
Message-ID: 1C16813DAFF3E44B939586605D40E9F01166AC64@ESESSMB107.ericsson.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Team,

We are facing some inconsistence behaviour of Postgres. We have deployed our database on a server where timezone is GMT+3 hours.
We have application which is running on the same server.

When application starts, it is inserting the correct timestamp in the table but after running few minutes/hours we have observed that 3 hours is added into the timestamp in table. The problem resolved once the application restarted.

Our application is putting correct data (checked by the insert query) and in DB it is seen that 3 hours is added. The figure 3 is slightly important as the server is deployed GMT+3 hours.

Below are some observations and some command output along with table structure.

JEDEMM02:/# date;
Tue Aug 5 16:41:52 AST 2014
db_1=# show timezone;
TimeZone
-------------
Asia/Riyadh
(1 row)

db_1=# select now();
now
-------------------------------
2014-08-05 16:43:06.372363+03
(1 row)

db_1=# select current_time;
timetz
--------------------
16:43:55.629946+03
(1 row)

Property in Postgres.conf
#timezone = '(defaults to server environment setting)'

Table Structure:
Column | Type | Modifiers
------------------------+-----------------------------+-----------
msisdn | character varying(100) |
offerid | character varying(100) |
expdatetime | timestamp without time zone |
smslang | character varying(20) |
renewalflag | character varying(100) |
insuffbalflag | character varying(100) |
unsubscribeoninsufflag | character varying(100) |
preexpiryduration | character varying(10) |

Regards,
M Tarkeshwar Rao

Responses

Browse pgsql-general by date

  From Date Subject
Next Message vpmm2007 2014-08-06 12:34:45 postgresql referencing and creating types as record
Previous Message Marc Mamin 2014-08-06 07:15:09 Re: understanding why two nearly identical queries take two different planner routes, one 5s and one 2hr