Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id C12BA133616B for ; Wed, 29 Dec 2010 13:18:29 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 31781-09 for ; Wed, 29 Dec 2010 17:18:22 +0000 (UTC) X-Greylist: delayed 00:06:36.177458 by SQLgrey-1.7.6 Received: from p3plsmtpa01-03.prod.phx3.secureserver.net (p3plsmtpa01-03.prod.phx3.secureserver.net [72.167.82.83]) by mail.postgresql.org (Postfix) with SMTP id A67281337B80 for ; Wed, 29 Dec 2010 13:18:21 -0400 (AST) Received: (qmail 30126 invoked from network); 29 Dec 2010 17:11:41 -0000 Received: from unknown (216.81.197.13) by p3plsmtpa01-03.prod.phx3.secureserver.net (72.167.82.83) with ESMTP; 29 Dec 2010 17:11:41 -0000 Message-ID: <4D1B6BCB.9040600@healthcareoss.com> Date: Wed, 29 Dec 2010 11:11:39 -0600 From: David Rericha User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101026 SUSE/3.0.10 Thunderbird/3.0.10 MIME-Version: 1.0 To: Tom Lane CC: pgsql-admin@postgresql.org Subject: Re: date out of range for timestamp References: <4D1A7AB3.4010008@healthcareoss.com> <13702.1293586580@sss.pgh.pa.us> <4D1A9D8E.70803@healthcareoss.com> <23542.1293590748@sss.pgh.pa.us> <4D1AA49F.8060706@healthcareoss.com> <23839.1293591973@sss.pgh.pa.us> In-Reply-To: <23839.1293591973@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201012/202 X-Sequence-Number: 36431 Tom, it seems to me that the planner's behavior in converting dates to timestamps in order to compare a date constant is a bug. I think I will submit it as such. If you enter a valid date into a field, you should be able to filter it even if that date exceeds the timestamp's range. Thanks again for your help. David J. Rericha OSS, LLC Projects Manager 563-650-5446 On 12/28/2010 09:06 PM, Tom Lane wrote: > David Rericha writes: > >> Thanks, Tom. That was it. After I ran analyze on the table, the error >> disappeared. >> > Yeah, I just duplicated the failure here. It only happens if the > comparison value falls into the histogram bucket adjoining the > out-of-range value, which is why you didn't see it happen for some > values of the comparison constant. Doesn't look too hard to fix. > > regards, tom lane > >