Re: BUG #1169: Select table.oid from view seems to loop - Mailing list pgsql-bugs

From Stephan Szabo
Subject Re: BUG #1169: Select table.oid from view seems to loop
Date
Msg-id 20040617074400.L45029@megazone.bigpanda.com
Whole thread Raw
In response to BUG #1169: Select table.oid from view seems to loop  ("PostgreSQL Bugs List" <pgsql-bugs@postgresql.org>)
List pgsql-bugs
On Thu, 17 Jun 2004, PostgreSQL Bugs List wrote:

> Description:        Select table.oid from view seems to loop
>
> Details:
>
> Hello!
>
> 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)

Note the notice.  IIRC the above is technically invalid SQL, but
PostgreSQL tries to do what it thinks you want which is to transform it
into:
 select table1.oid from view1, table1;

There's a GUC variable (add_missing_from) which allows you to control
whether it does the transform.

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #1169: Select table.oid from view seems to loop
Next
From: Richard Huxton
Date:
Subject: Re: BUG #1169: Select table.oid from view seems to loop