Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id A14A79FB28F for ; Wed, 4 Oct 2006 15:27:25 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 22224-03 for ; Wed, 4 Oct 2006 15:27:21 -0300 (ADT) X-Greylist: delayed 00:22:11.078668 by SQLgrey- Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id ED3EB9FB20C for ; Wed, 4 Oct 2006 15:27:20 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from mis010.exch010.intermedia.net (mis010.exch010.intermedia.net [64.78.61.97]) by svr4.postgresql.org (Postfix) with ESMTP id 46FAD5AF885 for ; Wed, 4 Oct 2006 18:05:04 +0000 (GMT) Received: from ehost010-33.exch010.intermedia.net ([64.78.20.173]) by mis010.exch010.intermedia.net with Microsoft SMTPSVC(6.0.3790.1830); Wed, 4 Oct 2006 11:03:08 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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> In-Reply-To: <20061003145134.GA3399@phlogiston.dyndns.org> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [SQL] Assigning a timestamp without timezone to a timestamp Thread-Index: Acbm+0NGaFIBej19Ry+sKYexJPDRBwA4/DzA From: "Hector Villarreal" To: "Andrew Sullivan" , "chrisj" Cc: X-OriginalArrivalTime: 04 Oct 2006 18:03:08.0725 (UTC) FILETIME=[5938B650:01C6E7DF] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.069 tagged_above=0 required=5 tests=SPF_NEUTRAL X-Spam-Level: * X-Archive-Number: 200610/51 X-Sequence-Number: 26440 Hi=20 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=20 And the subsequent select statement . I would appreciate an explanation on the select statement. I do not understand the syntax.=20 Thanks in advance=20 Hector Villarreal SELECT a.timestamp::timestamptz from (SELECT '2006-10-03 09:00'||"timezone" as timestamp from storetz where id =3D 1) as a; timestamp =20 -----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=3D# SELECT * from storetz ; id | timezone=20 ----+---------- 1 | -03 (1 row) testing=3D# SELECT a.timestamp::timestamptz from (SELECT '2006-10-03 09:00'||"timezone" as timestamp from storetz where id =3D 1) as a; timestamp =20 ------------------------ 2006-10-03 12:00:00+00 (1 row) A --=20 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