PG10 Partitioned tables and relation_is_updatable()

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: PG10 Partitioned tables and relation_is_updatable()
Date: 2017-06-11 11:32:48
Message-ID: CAEZATCXnbiFkMXgF4Ez1pmM2c-tS1z33bSq7OGbw7QQhHov+6Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

Regards,
Dean

Attachment Content-Type Size
teach-relation-is-updatable-about-partitioned-tables.patch application/octet-stream 3.7 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Christian Ullrich 2017-06-11 15:33:01 Buildfarm failures on woodlouse (in ecpg-check)
Previous Message Thomas Munro 2017-06-11 11:11:58 Re: RTE_NAMEDTUPLESTORE, enrtuples and comments