Re: Timezone difference between Oracle SYSDATE and PostgreSQL timestamp functions

From: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Vinayak *EXTERN*" <vinpokale(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Timezone difference between Oracle SYSDATE and PostgreSQL timestamp functions
Date: 2014-08-29 09:51:12
Message-ID: A737B7A37273E048B164557ADEF4A58B17D2FA61@ntex2010i.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Vinayak wrote:
> We have converted Oracle SYSDATE to PostgreSQL statement_timestamp() but
> there is a difference in timezone.
> SYSDATE returns the time on the server where the database instance is
> running(returns operating system time) so the time depends on the OS
> timezone setting.
> while the timezone of postgreSQL
> statement_timestamp()/now()/clock_timestamp() depends on the DBMS setting.
> so I think timezone settings are different between DBMS and OS.

[...]

> Any idea how can we set OS timezone on PostgreSQL?

If you mean the *server's* OS timezone, I guess you'd have to write
a C function that does something similar to identify_system_timezone()
in bin/initdb/findtimezone.c.

Yours,
Laurenz Albe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jacob Bunk Nielsen 2014-08-29 11:11:43 Re: Postgres 9.1 issues running data directory from VMware shared folder
Previous Message John R Pierce 2014-08-29 05:15:26 Re: Timezone difference between Oracle SYSDATE and PostgreSQL timestamp functions