From: Hector Villarreal <HVillarreal@mynewplace.com>
To: Andrew Sullivan <ajs@crankycanuck.ca>
To: chrisj <chrisj.wood@sympatico.ca>
Cc: pgsql-sql@postgresql.org
Subject: Re: Assigning a timestamp without timezone to a timestamp
Date: Wed, 4 Oct 2006 11:04:56 -0700
Message-ID: <8C5B026B51B6854CBE88121DBF097A864DE848@ehost010-33.exch010.intermedia.net> (raw)
In-Reply-To: <20061003145134.GA3399@phlogiston.dyndns.org>
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
-----Original Message-----
From: pgsql-sql-owner@postgresql.org
[mailto:pgsql-sql-owner@postgresql.org] On Behalf Of Andrew Sullivan
Sent: Tuesday, October 03, 2006 7:52 AM
To: chrisj
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] Assigning a timestamp without timezone to a timestamp
On Tue, Oct 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
--
Andrew Sullivan | ajs@crankycanuck.ca
When my information changes, I alter my conclusions. What do you do
sir?
--attr. John Maynard Keynes
---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: HVillarreal@mynewplace.com, ajs@crankycanuck.ca, chrisj.wood@sympatico.ca
Subject: Re: Assigning a timestamp without timezone to a timestamp
In-Reply-To: <8C5B026B51B6854CBE88121DBF097A864DE848@ehost010-33.exch010.intermedia.net>
References: <20061003145134.GA3399@phlogiston.dyndns.org> <8C5B026B51B6854CBE88121DBF097A864DE848@ehost010-33.exch010.intermedia.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox