Re: Fix for tablename in targetlist

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Fix for tablename in targetlist
Дата
Msg-id 200105191209.f4JC90D15198@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: Fix for tablename in targetlist  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
> 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
 


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Ondrej Palkovsky
Дата:
Сообщение: TRUNCATE doesn't follow referential integrity
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Plans for solving the VACUUM problem