Received: from candle.pha.pa.us (root@s5-03.ppp.op.net [209.152.195.67] (may be forged)) by hub.org (8.9.3/8.9.3) with ESMTP id RAA07042; Tue, 25 Jan 2000 17:44:16 -0500 (EST) (envelope-from pgman@candle.pha.pa.us) Received: (from pgman@localhost) by candle.pha.pa.us (8.9.0/8.9.0) id RAA25711; Tue, 25 Jan 2000 17:35:32 -0500 (EST) From: Bruce Momjian Message-Id: <200001252235.RAA25711@candle.pha.pa.us> Subject: Re: [HACKERS] Re: [SQL] DISTINCT ON: speak now or forever hold your peace In-Reply-To: <13995.948820606@sss.pgh.pa.us> from Tom Lane at "Jan 25, 2000 12:16:46 pm" To: Tom Lane Date: Tue, 25 Jan 2000 17:35:32 -0500 (EST) CC: Julian Scarfe , pgsql-hackers@postgreSQL.org, pgsql-sql X-Mailer: ELM [version 2.4ME+ PL66 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit > (BTW, ordinary SELECT DISTINCT has this same sort of problem if you try > to ORDER BY an expression that doesn't appear in the target list. > SQL92 avoids the issue by not allowing you to ORDER BY expressions that > aren't in the target list, period. We do allow that --- but not when > you use DISTINCT. Essentially, I want to enforce that same restriction > for DISTINCT ON.) > > The other piece of the puzzle would be to document that DISTINCT ON > keeps the first tuple out of each set with the same DISTINCT ON value. > > Does that sound like a plan? Yes, very clear. Good. -- Bruce Momjian | http://www.op.net/~candle pgman@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026