Re: Timezone difference between Oracle SYSDATE and PostgreSQL timestamp functions - Mailing list pgsql-general

From Albe Laurenz
Subject Re: Timezone difference between Oracle SYSDATE and PostgreSQL timestamp functions
Date
Msg-id A737B7A37273E048B164557ADEF4A58B17D2FA61@ntex2010i.host.magwien.gv.at
Whole thread Raw
In response to Timezone difference between Oracle SYSDATE and PostgreSQL timestamp functions  (Vinayak <vinpokale@gmail.com>)
List 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

pgsql-general by date:

Previous
From: John R Pierce
Date:
Subject: Re: Timezone difference between Oracle SYSDATE and PostgreSQL timestamp functions
Next
From: Jacob Bunk Nielsen
Date:
Subject: Re: Postgres 9.1 issues running data directory from VMware shared folder