X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 9ECB9D898B for ; Thu, 3 Nov 2005 13:22:36 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 82724-07 for ; Thu, 3 Nov 2005 17:22:34 +0000 (GMT) Received: from smtp-send.myrealbox.com (smtp-send.myrealbox.com [151.155.5.143]) by svr1.postgresql.org (Postfix) with ESMTP id 4AA22D8750 for ; Thu, 3 Nov 2005 13:22:34 -0400 (AST) Received: from [172.16.1.100] grzm [61.197.227.146] by smtp-send.myrealbox.com with NetMail SMTP Agent $Revision: 1.6 $ on Linux via secured & encrypted transport (TLS); Thu, 03 Nov 2005 10:22:28 -0700 In-Reply-To: <1131034672.3600.74.camel@Desarrollo> References: <1131034672.3600.74.camel@Desarrollo> Mime-Version: 1.0 (Apple Message framework v746.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <492564A9-C512-411D-BAC6-D48693CEDFA0@myrealbox.com> Cc: pgsql-sql@postgresql.org Content-Transfer-Encoding: 7bit From: Michael Glaesemann Subject: Re: date question Date: Fri, 4 Nov 2005 02:22:24 +0900 To: Judith Altamirano Figueroa X-Mailer: Apple Mail (2.746.2) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.274 required=5 tests=[AWL=0.274] X-Spam-Score: 0.274 X-Spam-Level: X-Archive-Number: 200511/46 X-Sequence-Number: 23298 On Nov 4, 2005, at 1:17 , Judith Altamirano Figueroa wrote: > Hi everybody, in Postgres 7.0.2 I have the next query: > > SELECT * from clientes_proceso where fecha_mod::date <= now() -1; > > but in version 8.0.1 returns the next error: > > ERROR: The operator doesn't exist: timestamp with time zone - integer > > How can drop a day to now()?? You can try a couple of different things: one is to use CURRENT_DATE - 1 instead of now() -1. Another would be to cast now() to date, e.g., now()::date - 1. Hope this helps. Michael Glaesemann grzm myrealbox com