Set default time zone for displaying dates in a session

From: Basil Bourque <basil(dot)list(at)me(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Set default time zone for displaying dates in a session
Date: 2011-01-28 04:54:02
Message-ID: 398F862A-DE62-4223-A8F7-44DF7D6EAFCF@me.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Is there a way to set a different time zone as the default for a session?

By default, Postgres displays my data stored in "TIMESTAMP WITH TIME ZONE" columns' data as a local time for the time zone of the computer hosting the Postgres cluster.

If my Postgres server is in Seattle, but my user is in New York, I want the times shown in New York time zone.

I know about using the "AT TIME ZONE" command. But:

(a) I would rather set the time zone once in each database connection/session rather than include it in all my individual SQL calls.

(b) When using "TABLE myTable;" or "SELECT * FROM myTable;", I cannot specify "AT TIME ZONE".

--Basil Boruque

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Lew 2011-01-28 11:39:33 Re: Unique constraint on only some of the rows
Previous Message Basil Bourque 2011-01-28 04:06:13 Re: new to postgreSql