Received: from mail1.hub.org (webmail.hub.org [216.126.85.1]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f9FNZPP71906 for ; Mon, 15 Oct 2001 19:35:25 -0400 (EDT) (envelope-from josh@agliodbs.com) Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by mail1.hub.org (8.11.3/8.11.4) with ESMTP id f9FMiAX60934 for ; Mon, 15 Oct 2001 18:44:10 -0400 (EDT) (envelope-from josh@agliodbs.com) Received: from [209.10.40.250] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 3.4.1) with HTTP id 148453; Mon, 15 Oct 2001 15:44:06 -0700 From: "Josh Berkus" Subject: Re: MEDIAN as custom aggregate? To: Tom Lane , "Josh Berkus" Cc: Allan Engelhardt , pgsql-sql@postgresql.org X-Mailer: CommuniGate Pro Web Mailer v.3.4.1 Date: Mon, 15 Oct 2001 15:44:06 -0700 Message-ID: In-Reply-To: <8803.1002951114@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Archive-Number: 200110/200 X-Sequence-Number: 5155 Tom, > Um ... does that work? I thought LIMIT was fairly restrictive about > what it would take as a parameter --- like, constants or $n > parameters > only. > > I do not know of any median-finding algorithm that doesn't require a > depressingly large amount of storage... Me neither. You're right; the query didn't work. Here's a link to the median-finding function I posted to the CookBook: http://www.brasileiro.net/postgres/cookbook/view-one-recipe.adp?recipe_id=1654 Anyone who can improve it is welcome! -Josh ______AGLIO DATABASE SOLUTIONS___________________________ Josh Berkus Complete information technology josh@agliodbs.com and data management solutions (415) 565-7293 for law firms, small businesses fax 621-2533 and non-profit organizations. San Francisco