Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 1B2FF9FB212 for ; Tue, 14 Nov 2006 11:09:20 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 89929-02 for ; Tue, 14 Nov 2006 15:09:04 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 46ACA9FA1DB for ; Tue, 14 Nov 2006 11:09:04 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from dougal.cranntara.net (unknown [217.112.91.201]) by svr4.postgresql.org (Postfix) with ESMTP id 501545AF91A for ; Tue, 14 Nov 2006 15:09:02 +0000 (GMT) Received: from client-181-p-2-lns.winn.dial.virgin.net ([81.103.216.180] helo=bolek.coachhouse) by dougal.cranntara.net with asmtp (Exim 3.36 #1 (Debian)) id 1Gjzvu-0003vc-00 for ; Tue, 14 Nov 2006 15:10:43 +0000 Received: (Exim 3.36) #1 (Debian)) protocol: esmtp id 1GjzoQ-0001fl-00 ; Tue, 14 Nov 2006 15:02:58 +0000 Message-ID: <4559DAA2.9090908@numerixtechnology.de> Date: Tue, 14 Nov 2006 15:02:58 +0000 From: T E Schmitz Reply-To: mailreg@numerixtechnology.de User-Agent: Debian Thunderbird 1.0.7 (X11/20051017) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: max (timestamp,timestamp) References: <45587718.2010009@numerixtechnology.de> <20061113140828.GD14281@a-kretschmer.de> <1f30b80c0611130629v4616365cr50c8fd99f01fce3a@mail.gmail.com> <20061113150643.GA34908@winnie.fuhr.org> In-Reply-To: <20061113150643.GA34908@winnie.fuhr.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.136 tagged_above=0 required=5 tests=BAYES_50, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200611/148 X-Sequence-Number: 26800 Michael Fuhr wrote: > On Mon, Nov 13, 2006 at 07:29:09PM +0500, imad wrote: > >>max (timestamptz, timestamptz) does not exist already. You need to >>create a simple function in PLpgSQL something like >> >>if a > b >>return a; >>else >>return b; > > > Since PostgreSQL 8.1 you can use GREATEST: > > test=> SELECT greatest(1, 2); That'll be a handy feature! Unfortunately, my server is still on 7.4. Thanks to everyone for the quick responses. -- Regards, Tarlika