X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 93BD99FA5C3 for ; Wed, 14 Jun 2006 01:15:46 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 01434-01 for ; Wed, 14 Jun 2006 01:15:42 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from stark.xeocode.com (stark.xeocode.com [216.58.44.227]) by postgresql.org (Postfix) with ESMTP id 764F69FA3C0 for ; Wed, 14 Jun 2006 01:15:41 -0300 (ADT) Received: from localhost ([127.0.0.1] helo=stark.xeocode.com) by stark.xeocode.com with smtp (Exim 3.36 #1 (Debian)) id 1FqMmx-0002QS-00; Wed, 14 Jun 2006 00:15:31 -0400 To: Tom Lane Cc: "Jim C. Nasby" , Antoine , pgsql-performance@postgresql.org Subject: Re: OT - select + must have from - sql standard syntax? References: <92d3a4950606130543y2aab73d8sbbbf04aee328b41f@mail.gmail.com> <20060613210246.GA34196@pervasive.com> <19096.1150253069@sss.pgh.pa.us> In-Reply-To: <19096.1150253069@sss.pgh.pa.us> From: Greg Stark Organization: The Emacs Conspiracy; member since 1992 Date: 14 Jun 2006 00:15:30 -0400 Message-ID: <87wtbkcqzh.fsf@stark.xeocode.com> Lines: 20 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/238 X-Sequence-Number: 19595 Tom Lane writes: > The spec does require a FROM clause in SELECT (at least as of SQL99, did > not check SQL2003). However, it's clearly mighty useful to allow FROM > to be omitted for simple compute-this-scalar-result problems. You > should respond to the Oracle guy that "SELECT whatever FROM dual" is not > in the standard either (certainly the spec does not mention any such > table). Well you could always create a "dual", it was always just a regular table. We used to joke about what would happen to Oracle if you inserted an extra row in it... Oracle used to always require FROM, if it has stopped requiring it then that's new. I had heard it had special-cased dual in later versions to avoid the table access overhead, I suspect these two changes are related. -- greg