Re: PG10 Partitioned tables and relation_is_updatable()

From: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>
To: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PG10 Partitioned tables and relation_is_updatable()
Date: 2017-06-12 08:29:44
Message-ID: CAFjFpRf0FUKsSH4NAY_m3T=bBLevxeEn6ZtLxUKdn=eDstmvSA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Jun 11, 2017 at 5:02 PM, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> wrote:
> Hi,
>
> It looks like relation_is_updatable() didn't get the message about
> partitioned tables. Thus, for example, information_schema.views and
> information_schema.columns report that simple views built on top of
> partitioned tables are non-updatable, which is wrong. Attached is a
> patch to fix this.
>
> I think this kind of omission is an easy mistake to make when adding a
> new relkind, so it might be worth having more pairs of eyes looking
> out for more of the same. I did a quick scan of the rewriter code
> (prompted by the recent similar omission for RLS on partitioned
> tables) and I didn't find any more problems there, but I haven't
> looked elsewhere yet.
>

Changes look good to me. In order to avoid such instances in future, I
have proposed to bundle the conditions as macros in [1].

--
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2017-06-12 08:49:58 Re: PG10 Partitioned tables and relation_is_updatable()
Previous Message Amit Langote 2017-06-12 08:09:31 Re: A bug in mapping attributes in ATExecAttachPartition()