Re: Materialized view assertion failure in HEAD

From: Kevin Grittner <kgrittn(at)ymail(dot)com>
To: Kevin Grittner <kgrittn(at)ymail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Joachim Wieland <joe(at)mcknight(dot)de>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Materialized view assertion failure in HEAD
Date: 2013-03-15 19:38:04
Message-ID: 1363376284.80809.YahooMailNeo@web162902.mail.bf1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Kevin Grittner <kgrittn(at)ymail(dot)com> wrote:
> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Kevin Grittner <kgrittn(at)ymail(dot)com> writes:
>>> I failed to touch everything necessary to prevent MVs from
>>> having OIDs.  This patch fixes the reported problem, and
>>> doesn't leave any gaps as far as I know; but I will do
>>> additional review to try to catch any other omissions.  I
>>> figured I should address the reported problem now, though.
>>
>>> Will push later today if there are no objections.
>>
>> I object --- that's not a fix, that's a crude hack.  It should
>> not be necessary to introduce relkind tests there.
>> Determination of whether OIDs exist in the target table should
>> happen well upstream, ie in whatever is constructing the
>> intoClause.  Otherwise we'll be fixing code that examines the
>> intoClause until doomsday.
>
> OK.  I started doing it that way, but saw how much more code was
> changed than this way and gave in to an impulse to do a minimal
> change.  I really need to resist that impulse more....

The presence of default_with_oids and the special-handling of the
oids option via interpretOidsOption() makes it hard to come up with
a solution which would qualify as "elegant".  Here's a rough cut at
an approach which seems best to me.  If this sits well with others
I'll add comments and think about that error message some more.
I'm not entirely sure I like accepting WITH (oids = false) but
throwing an error on WITH (oids = true), but it seems marginally
better than rejecting both.

Comments?

--
Kevin Grittner
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachment Content-Type Size
matview-nooids-fix-v2.patch text/x-patch 2.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message robins 2013-03-15 20:33:37 Re: Add some regression tests for SEQUENCE
Previous Message Tom Lane 2013-03-15 19:05:54 pg_test_fsync crashes on systems with POSIX signal handling