Re: BUG in temp tables involving a temp table not properly

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Frank van Vugt <ftm(dot)van(dot)vugt(at)foxi(dot)nl>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG in temp tables involving a temp table not properly
Date: 2005-06-07 16:23:32
Message-ID: 20050607092014.E1265@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-bugs by date

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