Re: BUG in temp tables involving a temp table not properly - Mailing list pgsql-bugs

From Stephan Szabo
Subject Re: BUG in temp tables involving a temp table not properly
Date
Msg-id 20050607092014.E1265@megazone.bigpanda.com
Whole thread Raw
In response to BUG in temp tables involving a temp table not properly hiding a regular table as well as allowing non-existent column names  (Frank van Vugt <ftm.van.vugt@foxi.nl>)
Responses Re: BUG in temp tables involving a temp table not properly
List pgsql-bugs
On Tue, 7 Jun 2005, Frank van Vugt wrote:

> Looking forward to your analysis of the following bug:

You've analyzed the situation incorrectly I believe.

> -- however, the following query will happily run AND return a wrong result
> -- based on the regular table instead of the temporary one
> select count(*) from full_sequence(1, 100) where id in (select id from f1);

In this query in the subselect the id column is an outer
reference to the id column generated from full_sequence.  As far as I can
see, as long as there is at least one row in f1, all the rows generated by
full_sequence will match since it will compare the id in the outer row
against itself (and they are non null). This behavior is marginally
unfortunate, but seems to be required by spec.

pgsql-bugs by date:

Previous
From: Frank van Vugt
Date:
Subject: BUG in temp tables involving a temp table not properly hiding a regular table as well as allowing non-existent column names
Next
From: Tom Lane
Date:
Subject: Re: BUG in temp tables involving a temp table not properly hiding a regular table as well as allowing non-existent column names