FAQ
I have read the docs twice; I have tried all sorts of things;

there must be some way to do this simple thing:



Take the result of "show timezone", and assign it to a variable

in a function.



murf

Search Discussions

  • Merlin Moncure at May 24, 2011 at 1:43 pm

    On Tue, May 24, 2011 at 8:09 AM, Steve Murphy wrote:
    I have read the docs twice; I have tried all sorts of things;

    there must be some way to do this simple thing:



    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.

    merlin
  • Tom Lane at May 24, 2011 at 1:49 pm

    Merlin Moncure writes:
    On Tue, May 24, 2011 at 8:09 AM, Steve Murphy 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.

    regards, tom lane
  • Merlin Moncure at May 24, 2011 at 1:59 pm

    On Tue, May 24, 2011 at 8:49 AM, Tom Lane wrote:
    Merlin Moncure <mmoncure@gmail.com> writes:
    On Tue, May 24, 2011 at 8:09 AM, Steve Murphy 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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-novice @
categoriespostgresql
postedMay 24, '11 at 1:21p
activeMay 24, '11 at 1:59p
posts4
users3
websitepostgresql.org
irc#postgresql

People

Translate

site design / logo © 2022 Grokbase