Re: Assign the system timezone to a variable in a function? - Mailing list pgsql-novice

From Merlin Moncure
Subject Re: Assign the system timezone to a variable in a function?
Date
Msg-id BANLkTikYH=_WvcVgTm_MKtjEYnbrTuTdOw@mail.gmail.com
Whole thread Raw
In response to Re: Assign the system timezone to a variable in a function?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-novice
On Tue, May 24, 2011 at 8:49 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Merlin Moncure <mmoncure@gmail.com> writes:
>> On Tue, May 24, 2011 at 8:09 AM, Steve Murphy <smurphy@intorrent.com> wrote:
>>> Take the result of "show timezone", and assign it to a variable
>>> in a function.
>
>> I was about to suggest querying the pg_settings table, then noticed
>> there was no 'timezone' record in it, which is pretty odd imo.  You
>> can look at the log_timezone record however, which might be correct.
>
> It's spelled "TimeZone" for historical reasons.  See also the
> current_setting() function.

whoops!  I should have known... :-).  Yeah, the current_setting()
function is just a hair faster than grepping the pg_settings view for
the right answer, and so is really the better way to go anyways.  It
also is case agnostic apparently.

merlin

pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: Assign the system timezone to a variable in a function?
Next
From: Chris Campbell
Date:
Subject: UTF8 and Accented Characters