Re: BUG #1169: Select table.oid from view seems to loop

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: BUG #1169: Select table.oid from view seems to loop
Дата
Msg-id 40D1A0D2.5060000@archonet.com
обсуждение исходный текст
Ответ на BUG #1169: Select table.oid from view seems to loop  ("PostgreSQL Bugs List" <pgsql-bugs@postgresql.org>)
Ответы Re: BUG #1169: Select table.oid from view seems to loop
Список pgsql-bugs
PostgreSQL Bugs List wrote:
> The following bug has been logged online:
>
> Bug reference:      1169
> Logged by:          Robert Osowiecki
>
> Email address:      robson@cavern.pl
> PostgreSQL version: 7.4
> Operating system:   Linux
> Description:        Select table.oid from view seems to loop

> Here's what i found:
>
> select count(*) from view1;
>  count
> -------
>  12874
> (1 row)
>
> select table1.oid from view1;
> NOTICE:  adding missing FROM-clause entry for table "table1"
> (psql crashes)

This statement is probably not what you meant to say. There is no
"table1.oid" in view1, so PG is adding a reference to table1, turning
your query into:

   SELECT table1.oid FROM view1, table1;

This gives you the product of both relations, e.g. if you have 2000 rows
in view1 and 3000 in table1 that's 6,000,000 rows in total. You probably
run out of memory somewhere which looks like a crash.

In 7.4 there is a postgresql.conf setting to control this behaviour
(add_missing_from). I'd turn it off, as I've always found it to cause
problems rather than solve them.

HTH
--
   Richard Huxton
   Archonet Ltd

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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: BUG #1169: Select table.oid from view seems to loop
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: BUG #1167: POSIX getpwuid_r 4arg vs 5arg issue