Adding 3 hours while inserting data into table - Mailing list pgsql-general

From M Tarkeshwar Rao
Subject Adding 3 hours while inserting data into table
Date
Msg-id 1C16813DAFF3E44B939586605D40E9F01166AC64@ESESSMB107.ericsson.se
Whole thread Raw
Responses Re: Adding 3 hours while inserting data into table  (Adrian Klaver <adrian.klaver@aklaver.com>)
List 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

pgsql-general by date:

Previous
From: Marc Mamin
Date:
Subject: Re: understanding why two nearly identical queries take two different planner routes, one 5s and one 2hr
Next
From: Adrian Klaver
Date:
Subject: Re: Adding 3 hours while inserting data into table