Databases

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • Assigning a timestamp without timezone to a timestamp

    0 answers - 1805 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    Hi
    I am also interested in this type of setup. However, in the example
    below
    I am a little confused as to why the table entry is 1, -3
    And the subsequent select statement . I would appreciate an explanation
    on the select statement. I do not understand the syntax.
    Thanks in advance
    Hector Villarreal
    SELECT a.timestamp::timestamptz from (SELECT '2006-10-03
    09:00'||"timezone" as timestamp from storetz where id = 1) as a;
    timestamp
    Message
    From: pgsql-sql-owner (AT) postgresql (DOT) org
    [mailto:pgsql-sql-owner (AT) postgresql (DOT) org] Behalf Andrew Sullivan
    Sent: Tuesday, 03, 2006 7:52 AM
    To: chrisj
    Cc: pgsql-sql (AT) postgresql (DOT) org
    Subject: Re: [SQL] Assigning a timestamp without timezone to a timestamp
    Tue, 03, 2006 at 07:26:52AM -0700, chrisj wrote:
    location, but they are the directive to all store locations saying:
    "In the
    context of the timezone your store is located in, these are the hours
    you
    should be open.
    Ah. Well, then, right, it _does_ have to be timezone free. That's
    actually the only case I'd use that. Sorry, I'm dim, and didn't
    understand properly what you were doing. (I read the "relative to
    the store's own time zone" to refer to the corporate office. No, I
    don't know why, either. Told you I'm dim.)
    Anyway, here's something that worked for me (expanding this into your
    case ought not to be too tricky):
    testing=# SELECT * from storetz ;
    id | timezone
    +
    1 | -03
    (1 row)
    testing=# SELECT a.timestamp::timestamptz from (SELECT '2006-10-03
    09:00'||"timezone" as timestamp from storetz where id = 1) as a;
    timestamp
    2006-10-03 12:00:00+00
    (1 row)
    A

Re: Assigning a timestamp without timezone to a timestamp


max 4000 letters.
Your nickname that display:
In order to stop the spam: 2 + 1 =
QUESTION ON "Databases"

EMSDN.COM