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.

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

Reply via email to