X-Original-To: pgsql-patches-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 78F84329ECE for ; Tue, 21 Sep 2004 18:14:29 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 07566-08 for ; Tue, 21 Sep 2004 17:14:19 +0000 (GMT) Received: from stark.xeocode.com (gsstark.mtl.istop.com [66.11.160.162]) by svr1.postgresql.org (Postfix) with ESMTP id 0CB3D329EC9 for ; Tue, 21 Sep 2004 18:14:19 +0100 (BST) Received: from localhost ([127.0.0.1] helo=stark.xeocode.com) by stark.xeocode.com with smtp (Exim 3.36 #1 (Debian)) id 1C9oDX-0007lC-00; Tue, 21 Sep 2004 13:14:16 -0400 To: Tom Lane Cc: Greg Stark , mailreg@numerixtechnology.de, pgsql-patches@postgresql.org Subject: Re: [SQL] COUNT(*) to find records which have a certain number of dependencies ? References: <414EF3E6.9040202@numerixtechnology.de> <87llf4hjv2.fsf@stark.xeocode.com> <414F348A.2020608@numerixtechnology.de> <877jqohdoj.fsf@stark.xeocode.com> <414F43A8.8000101@numerixtechnology.de> <87y8j4fwmb.fsf@stark.xeocode.com> <23046.1095722596@sss.pgh.pa.us> In-Reply-To: <23046.1095722596@sss.pgh.pa.us> From: Greg Stark Organization: The Emacs Conspiracy; member since 1992 Date: 21 Sep 2004 13:14:15 -0400 Message-ID: <878yb3fst4.fsf@stark.xeocode.com> Lines: 37 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/236 X-Sequence-Number: 13098 Tom Lane writes: > Greg Stark writes: > > This patch allows subqueries without aliases. This is SQL-non-spec-compliant > > syntax that Oracle supports and many users expect to work. > > AFAIR you're the first to propose that we ignore the SQL spec here. > When I wrote "see if anyone complains", I had in mind waiting for > quite a few complaints before contemplating changing this... I understand. But I expect there are lots of users this annoys. It's just such an easy thing to work around that it would be a petty thing to complain about. That's the only reason I never complained about it all this time it was annoying me. Not until I felt ready to poke around and fix it myself. And I'm not suggesting ignoring the spec, just allowing the user to ignore it, and not having postgres go out of its way to enforce the spec on users. I doubt the spec says that the implementation cannot allow the syntax. ...Ok, well I wouldn't put it past the spec to do so. But it does so about lots of things that Postgres allows. The general attitude postgres has seems to be to extend the spec whenever it's nice for the user as long as doing so doesn't interfere with actually supporting any spec compliant code. It's not like postgres is a good platform for testing spec compliance of SQL code otherwise. It just seems excessively obnoxious to refuse queries because they don't match a grammar precisely when the missing piece is entirely not needed by the database. It doesn't cause any ambiguity or other problems with the SQL. It doesn't cost a single cycle in the normal case. The code doesn't impact anything else in the system. It's the database being intentionally nosy and picky about something just because it can. -- greg