Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 474849FBCA2 for ; Thu, 5 Apr 2007 12:24:33 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 02921-01 for ; Thu, 5 Apr 2007 12:24:27 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from exchange.g2switchworks.com (mail.g2switchworks.com [63.87.162.25]) by postgresql.org (Postfix) with ESMTP id D26C69FBCB2 for ; Thu, 5 Apr 2007 12:24:27 -0300 (ADT) Received: from 10.10.1.37 ([10.10.1.37]) by exchange.g2switchworks.com ([10.10.1.2]) with Microsoft Exchange Server HTTP-DAV ; Thu, 5 Apr 2007 15:24:27 +0000 Received: from state.g2switchworks.com by mail.g2switchworks.com; 05 Apr 2007 10:24:26 -0500 Subject: Re: Generating dates prior to generate_series From: Scott Marlowe To: Roger Tannous Cc: PostgreSQL SQL Mailing List In-Reply-To: <580286.82124.qm@web90602.mail.mud.yahoo.com> References: <580286.82124.qm@web90602.mail.mud.yahoo.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1175786666.9839.33.camel@state.g2switchworks.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Thu, 05 Apr 2007 10:24:26 -0500 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/77 X-Sequence-Number: 28077 On Wed, 2007-04-04 at 07:00, Roger Tannous wrote: > I'm using PostgreSQL version 7.3.2, and generate_series() is not > available, so this is a function to generate a series dates. > > The function goes backwards if the second argument is less than the first > one. Check the two select statements at the end. As someone who is still responsible for the care and feeding of a 7.4 database, thanks for the function. You really should upgrade to the latest 7.3.xx version, as there were many data loss bugs in earlier 7.3.xx versions that have been fixed.