Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id DA0C29FB2BF for ; Tue, 3 Oct 2006 11:51:55 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 20303-09 for ; Tue, 3 Oct 2006 14:51:46 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from main2.mycybernet.net (main2.mycybernet.net [209.222.63.140]) by postgresql.org (Postfix) with ESMTP id 316549FB26B for ; Tue, 3 Oct 2006 11:51:45 -0300 (ADT) Received: from 227-54-222-209.mycybernet.net ([209.222.54.227] helo=phlogiston.dydns.org) by main2.mycybernet.net with esmtp (Exim 4.62) (envelope-from ) id 1GUluP-0006Zj-8p; Tue, 03 Oct 2006 11:10:13 -0400 Received: by phlogiston.dydns.org (Postfix, from userid 1000) id 0A1484051; Tue, 3 Oct 2006 10:51:34 -0400 (EDT) Date: Tue, 3 Oct 2006 10:51:34 -0400 From: Andrew Sullivan To: chrisj Cc: pgsql-sql@postgresql.org Subject: Re: Assigning a timestamp without timezone to a timestamp Message-ID: <20061003145134.GA3399@phlogiston.dyndns.org> References: <6613652.post@talk.nabble.com> <20061003135623.GB3191@phlogiston.dyndns.org> <6621346.post@talk.nabble.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6621346.post@talk.nabble.com> User-Agent: Mutt/1.5.9i X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200610/21 X-Sequence-Number: 26410 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