Re: Different results from identical matviews - Mailing list pgsql-general

From Tom Lane
Subject Re: Different results from identical matviews
Date
Msg-id 849797.1593697489@sss.pgh.pa.us
Whole thread Raw
In response to Re: Different results from identical matviews  (Anders Steinlein <anders@e5r.no>)
Responses Re: Different results from identical matviews
List pgsql-general
Anders Steinlein <anders@e5r.no> writes:
> On Thu, Jul 2, 2020 at 2:02 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I suspect the query underlying the matviews is less deterministic than
>> you think it is.

> Thanks for the tip, but I'm having a hard time thinking that's the case,
> seeing as I'm unable to trigger the wrong result no matter how hard I try
> with a new definition/manual query.

Well, another line of thought is that there actually is some difference
between the stored query for the original matview and the ones you enter
afresh.  You said they were the same, but I surely didn't attempt to
verify that.  Comparing pg_get_viewdef() output for equality would be
a good first step.  Even that perhaps isn't conclusive, so you could
also try comparing the pg_rewrite.ev_action fields for the views'
ON SELECT rules.  (That might be a bit frustrating because of likely
inconsistencies in node "location" fields; but any other difference
is cause for suspicion.)

            regards, tom lane



pgsql-general by date:

Previous
From: Paul Förster
Date:
Subject: Re: Different results from identical matviews
Next
From: "David G. Johnston"
Date:
Subject: Re: Different results from identical matviews