> Bruce Momjian writes:
>
> > This patch fixes the problem by generating an error in the parser:
> >
> > test=> select pg_class from pg_class;
> > ERROR: You can't use a relation alone in a target list.
>
> Maybe it's the parser that's getting it wrong. What if pg_class has a
> column called pg_class?
The parser doesn't know about columns or table names. It just passes
them along. The code checks the indent and sets isRel if it matches
something in the range table. Seems like it checks for column matches
in the range table first. Looks OK:test=> create table test (test int);CREATEtest=> insert into test values (1);INSERT
1455701test=> select test from test; test ------ 1(1 row)
-- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610)
853-3000+ If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill,
Pennsylvania19026