From: Greg Stark <gsstark@mit.edu>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Jim C. Nasby <jnasby@pervasive.com>
Cc: Antoine <melser.anton@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: OT - select + must have from - sql standard syntax?
Date: 14 Jun 2006 00:15:30 -0400
Message-ID: <87wtbkcqzh.fsf@stark.xeocode.com> (raw)
In-Reply-To: <19096.1150253069@sss.pgh.pa.us>
References: <92d3a4950606130543y2aab73d8sbbbf04aee328b41f@mail.gmail.com>
<20060613210246.GA34196@pervasive.com>
<19096.1150253069@sss.pgh.pa.us>
Tom Lane <tgl@sss.pgh.pa.us> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: gsstark@mit.edu, tgl@sss.pgh.pa.us, jnasby@pervasive.com, melser.anton@gmail.com
Subject: Re: OT - select + must have from - sql standard syntax?
In-Reply-To: <87wtbkcqzh.fsf@stark.xeocode.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox