pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bill MacArthur <webmaster@dhs-club.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #7604: adding criteria to a query against a view in 9.2 expands the results instead of constraining them
Date: Mon, 15 Oct 2012 14:29:43 -0400
Message-ID: <29762.1350325783@sss.pgh.pa.us> (raw)
In-Reply-To: <507C53F3.70606@dhs-club.com>
References: <E1TNn6X-0003vO-1x@wrigleys.postgresql.org>
	<13773.1350317896@sss.pgh.pa.us>
	<507C53F3.70606@dhs-club.com>

Bill MacArthur <webmaster@dhs-club.com> writes:
> Tom, in preparation for a test case I created a new schema (testcase) and copied 6 tables to that, including only the columns significant to enable the VIEWs to be created. I took the 3 VIEWs involved and tweaked them into the new schema (just renamed to testcase.viewname and referencing testcase.relation). However, when run from in there, the results are as expected rather than erroneous. The live data and VIEWs still produce erroneous results. Any clues??

Is the query plan the same according to EXPLAIN?

If not, you may have forgotten to vacuum/analyze the new tables, or
forgotten some relevant index.  Or it might be that the total table size
is affecting the plan choice, in which case you need dummy data in the
"irrelevant" columns rather than removing them altogether.

			regards, tom lane




view thread (6+ messages)  latest in thread

Message-ID: <29762.1350325783@sss.pgh.pa.us>
Permalink:  ../29762.1350325783@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/29762.1350325783@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, webmaster@dhs-club.com
  Subject: Re: BUG #7604: adding criteria to a query against a view in 9.2 expands the results instead of constraining them
  In-Reply-To: <29762.1350325783@sss.pgh.pa.us>
  References: <E1TNn6X-0003vO-1x@wrigleys.postgresql.org> <13773.1350317896@sss.pgh.pa.us> <507C53F3.70606@dhs-club.com> <29762.1350325783@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox