Gurjeet Singh <singh(dot)gurjeet(at)gmail(dot)com> writes:
> On Mon, Jan 14, 2013 at 4:15 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> David Johnston <polobo(at)yahoo(dot)com> writes:
>>> SELECT *;
>>> Results in:
>>> SQL Error: ERROR: SELECT * with no tables specified is not valid
> Interesting to note that SELECT * FROM table_with_zero_cols does not
> complain of anything.
Yeah. IIRC that error check long predates our support for zero-column
tables (which we allowed when we introduced ALTER TABLE DROP COLUMN,
so that dropping the only column doesn't have to be an error case).
You could argue that the existence of zero-column tables makes the
error check inconsistent, but I think it's probably good as-is. The
possibility that "*" can sometimes validly expand to no columns doesn't
mean that "SELECT *;" isn't almost surely a typo.
regards, tom lane
In response to
pgsql-hackers by date
|Next:||From: Peter Eisentraut||Date: 2013-01-15 15:51:53|
|Subject: Re: pg_ctl idempotent option|
|Previous:||From: Alvaro Herrera||Date: 2013-01-15 15:49:52|
|Subject: Re: ALTER command reworks|