Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id B126313364DE for ; Tue, 28 Dec 2010 23:02:04 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 00605-06 for ; Wed, 29 Dec 2010 03:01:55 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtpauth12.prod.mesa1.secureserver.net (smtpauth12.prod.mesa1.secureserver.net [64.202.165.35]) by mail.postgresql.org (Postfix) with SMTP id B5DF9133616B for ; Tue, 28 Dec 2010 23:01:54 -0400 (AST) Received: (qmail 28520 invoked from network); 29 Dec 2010 03:01:53 -0000 Received: from unknown (173.18.52.92) by smtpauth12.prod.mesa1.secureserver.net (64.202.165.35) with ESMTP; 29 Dec 2010 03:01:52 -0000 Message-ID: <4D1AA49F.8060706@healthcareoss.com> Date: Tue, 28 Dec 2010 21:01:51 -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> In-Reply-To: <23542.1293590748@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/200 X-Sequence-Number: 36429 Thanks, Tom. That was it. After I ran analyze on the table, the error disappeared. David J. Rericha OSS, LLC Projects Manager 563-650-5446 On 12/28/2010 08:45 PM, Tom Lane wrote: > [ please keep the list cc'd ] > > David Rericha writes: > >> I am truly typing the date as a literal. It turned out that I did have >> a date of year 2010000, which would have been out of range, but I >> changed it. But I still get the error. >> > Hmm. Try re-running ANALYZE on the table. I'm thinking that maybe > (a) the way-out-of-line date is still in the statistical histogram, and > (b) the planner is using date-to-timestamp coercion while trying to > estimate the selectivity of the <= condition. > > regards, tom lane > > >