X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id DBBBFD1D1A4 for ; Thu, 5 Feb 2004 16:54:23 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 70957-10 for ; Thu, 5 Feb 2004 12:54:21 -0400 (AST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 2AD5BD1CE3E for ; Thu, 5 Feb 2004 12:54:20 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i15GsFgb003969; Thu, 5 Feb 2004 11:54:15 -0500 (EST) To: "Raman Garg" Cc: "Richard Huxton" , "pgsql-sql" Subject: Re: TIME ZONE SQL In-reply-to: <00e001c3ebf8$bd6efc50$d4c7a8c0@raman> References: <200402042003.07189.dev@archonet.com> <006101c3ebc2$134c0dc0$d4c7a8c0@raman> <200402051100.58825.dev@archonet.com> <00e001c3ebf8$bd6efc50$d4c7a8c0@raman> Comments: In-reply-to "Raman Garg" message dated "Thu, 05 Feb 2004 20:29:57 +0530" Date: Thu, 05 Feb 2004 11:54:15 -0500 Message-ID: <3968.1076000055@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/56 X-Sequence-Number: 16747 "Raman Garg" writes: > Actually my "between" is creating some problems and is not giving me results > so what I have done is . IN MY WHERE CLAUSE OF QUERY: I suspect that this revised clause will give you problems too, namely selecting rows you don't want. I think what may actually be happening here is that you have times wrapping around past midnight. For instance consider regression=# select '10:30'::time + '15 hours'::interval; ?column? ---------- 01:30:00 (1 row) regression=# select '10:30'::time - '15 hours'::interval; ?column? ---------- 19:30:00 (1 row) It seems to me that your approach to the problem is all wrong, and you need to be using timestamp-based calculations not time-of-day-based calculations. regards, tom lane