Re: Is user_catalog_table sensible for matviews?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Is user_catalog_table sensible for matviews?
Date: 2016-11-10 14:27:40
Message-ID: 3535.1478788060@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)anarazel(dot)de> writes:
> On 2016-11-09 12:55:51 -0500, Robert Haas wrote:
>> On Wed, Nov 9, 2016 at 12:17 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>> The system will let you set the "user_catalog_table" reloption to "true"
>>> on a materialized view. Is this sensible, or is it a bug caused by the
>>> fact that reloptions.c fails to distinguish matviews from heaps at all?
>>> If it is sensible, then I broke it in e3e66d8a9 ...

>> I can understand what that combination of opens would mean from a
>> semantic point of view, so I don't think it's insensible. However, it
>> doesn't seem like an important combination to support, and I suspect
>> that the fact that we did was accidental.

> I don't see it as being important either. I suspect we intentionally
> didn't exclude it, but less because of a use-case and more because there
> didn't seem to be a need to.

I think it's fundamentally wrong that reloptions.c doesn't distinguish
matviews from heaps. You can argue about whether this particular case
is okay or not, but sooner or later there's going to be an option that
only applies to one of them. So I plan to invent RELOPT_KIND_MATVIEW
while I'm rejiggering things to fix the rd_options type safety issue.

Having done that, we could either allow this for matviews or not.
I'm agnostic. However, unless we feel like back-patching some
modification of e3e66d8a9, 9.5.x and 9.6.x are effectively not
going to allow it (they'd take the option but then ignore it).
I guess that's arguably a bug in itself.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2016-11-10 14:36:32 Re: Copying Permissions
Previous Message Stephen Frost 2016-11-10 14:25:34 Re: Improving RLS planning