Re: How do we get the Client-Time and Server-Time from psql ?

Поиск
Список
Период
Сортировка
От Steve Crawford
Тема Re: How do we get the Client-Time and Server-Time from psql ?
Дата
Msg-id 4C06FA0D.9050406@pinpointresearch.com
обсуждение исходный текст
Ответ на Re: How do we get the Client-Time and Server-Time from psql ?  (raghavendra t <raagavendra.rao@gmail.com>)
Ответы Re: How do we get the Client-Time and Server-Time from psql ?  (raghavendra t <raagavendra.rao@gmail.com>)
Список pgsql-general
On 06/02/2010 03:29 PM, raghavendra t wrote:
> ...
> Suppose am at the server-end, how could i get the client-time. Its
> really troublesome when compared with the timezone column in a table.
>
Not sure what you are getting at. You are always connected to the server
_through_ a client and you _tell_ the server your timezone preferences.

As long as you are using timestamptz and as long as the client properly
sets its preferred time-zone prior to issuing queries or gives
fully-qualified timestamps with TZ, then you are fine.

Alternately, you can use (for libpq clients) the PGTZ environment variable.

Or you can set things on a per-user basis:
alter user foo set timezone to 'SOMETZ';

Or for things like web-apps where the client-side of the connection to
the database is probably through a single database-user and the actual
users are all over the place you can set up a table of user-preferences
and set the timezone appropriately.

Cheers,
Steve


В списке pgsql-general по дате отправления:

Предыдущее
От: John R Pierce
Дата:
Сообщение: Re: Don't' Understand the Processes Listing Associated with Postgres
Следующее
От: "Wang, Mary Y"
Дата:
Сообщение: Autovacuum Daemon is Turned On by Default in Postgres 8.3.8?