Re: Wrong rows selected with view - Mailing list pgsql-general

From Andreas Seltenreich
Subject Re: Wrong rows selected with view
Date
Msg-id 87irushcxg.fsf@gate450.dyndns.org
Whole thread Raw
In response to Wrong rows selected with view  (Bill Moseley <moseley@hank.org>)
Responses Re: Wrong rows selected with view  (Bill Moseley <moseley@hank.org>)
List pgsql-general
Bill Moseley writes:

> PostgreSQL 7.4.8 on i486-pc-linux-gnu, compiled by GCC cc (GCC) 4.0.2 20050816 (prerelease) (Debian 4.0.1-5)
>
> Hopefully this is something simple -- I assume it's a problem with my
> SQL.  But it looks really weird to me at this late hour.
>
> I have some tables for managing workshops, and I have a view (below).
> I noticed for a given select it was returning the wrong number of
> rows.  I expected seven rows back, but only got six.
>
> I rewrote the view with just the joins and it returned the correct number
> of rows.  So I started the brute force method of removing one thing at
> a time in the view to see what would make it start returning the
> correct number of rows.  That just confused me more.

How does the query plan change when you make those changes? If it only
occurs if a certain index is used, it might be corrupt (=> REINDEX).

regards,
Andreas

pgsql-general by date:

Previous
From: "Thies C. Arntzen"
Date:
Subject: Re: shouldn't postgres know the numer of rows in a (sorted) result-set before returning the first row?
Next
From: Martijn van Oosterhout
Date:
Subject: Re: shouldn't postgres know the numer of rows in a (sorted) result-set before returning the first row?