X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3CAE4329E80 for ; Mon, 20 Sep 2004 21:45:57 +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 09548-02 for ; Mon, 20 Sep 2004 20:45:50 +0000 (GMT) Received: from stark.xeocode.com (gsstark.mtl.istop.com [66.11.160.162]) by svr1.postgresql.org (Postfix) with ESMTP id 6480D329E7E for ; Mon, 20 Sep 2004 21:45:51 +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 1C9V2j-0002tV-00; Mon, 20 Sep 2004 16:45:49 -0400 To: mailreg@numerixtechnology.de Cc: Greg Stark , pgsql-sql@postgresql.org Subject: Re: 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> In-Reply-To: <414F348A.2020608@numerixtechnology.de> From: Greg Stark Organization: The Emacs Conspiracy; member since 1992 Date: 20 Sep 2004 16:45:48 -0400 Message-ID: <877jqohdoj.fsf@stark.xeocode.com> Lines: 30 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/169 X-Sequence-Number: 19015 T E Schmitz writes: > ) as somealias on (model_fk = model_pk) > > (subquery in FROM must have an alias) ARGH! This is one of the most annoying things about postgres! It bites me all the time. Obviously it's totally insignificant since it's easy for my to just throw an "AS x" on the end of it. But damn. I see there's a comment foreseeing some annoyance value for this in the source: /* * The SQL spec does not permit a subselect * () without an alias clause, * so we don't either. This avoids the problem * of needing to invent a unique refname for it. * That could be surmounted if there's sufficient * popular demand, but for now let's just implement * the spec and see if anyone complains. * However, it does seem like a good idea to emit * an error message that's better than "syntax error". */ So where can I officially register my complaint? :) -- greg