Received: from localhost (unknown [200.46.204.184]) by developer.postgresql.org (Postfix) with ESMTP id 352AF2E0038 for ; Sun, 4 May 2008 14:59:25 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 55322-10 for ; Sun, 4 May 2008 14:59:19 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by developer.postgresql.org (Postfix) with ESMTP id A23AA2E002D for ; Sun, 4 May 2008 14:59:21 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.14.1/8.14.1) with ESMTP id m44HxJ6W092589 for ; Sun, 4 May 2008 14:59:19 -0300 (ADT) (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.14.1/8.14.1/Submit) id m44Hoa6X090076 for pgsql-performance@postgresql.org; Sun, 4 May 2008 14:50:36 -0300 (ADT) (envelope-from news) From: Hannes Dorbath X-Newsgroups: pgsql.performance Subject: Re: Fastest way / best practice to calculate "next birthdays" Date: Sun, 04 May 2008 19:50:37 +0200 Organization: Hub.Org Networking Services Lines: 18 Message-ID: <481DF76D.3060807@theendofthetunnel.de> References: <481DE036.90706@commandprompt.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@news.hub.org To: "Joshua D. Drake" User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) In-Reply-To: <481DE036.90706@commandprompt.com> To: pgsql-performance@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/47 X-Sequence-Number: 30015 Joshua D. Drake wrote: > postgres=# SELECT current_date|| ' a ' || to_char(current_date, 'Day'), > current_date + '1 Year'::interval || ' a ' || to_char(current_date + '1 > Year'::interval, 'Day') as next_birthday; > ?column? | next_birthday > ------------------------+--------------------------------- > 2008-05-04 a Sunday | 2009-05-04 00:00:00 a Monday > > ? Sorry, I think I phrased the question badly. What I'm after basically is: http://www.depesz.com/index.php/2007/10/26/who-has-birthday-tomorrow/ -- Best regards, Hannes Dorbath