Re: how to find out whether a view is updatable

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: how to find out whether a view is updatable
Date: 2013-06-11 21:53:45
Message-ID: 19797.1370987625@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> writes:
> Here's a more complete patch along those lines. It defines the
> following pair of functions to test for updatability from SQL:

> FUNCTION pg_catalog.pg_relation_is_updatable(reloid oid,
> include_triggers boolean)
> RETURNS integer

> FUNCTION pg_catalog.pg_column_is_updatable(reloid oid,
> attnum smallint,
> include_triggers boolean)
> RETURNS boolean

> and the following FDW functions:

> int IsForeignRelUpdatable (Oid foreigntableid);

> bool IsForeignColUpdatable (Oid foreigntableid,
> AttrNumber attnum);

I'm looking at this patch now. I do not see the point of
pg_column_is_updatable nor IsForeignColUpdatable --- that's loading
additional complexity onto every FDW, to support what use-cases exactly?
Is it really likely that (a) there are any cases out there where FDWs
would support updating only some columns, and (b) anybody would care
whether or not information_schema.columns reflects such a restriction
accurately? So I'm inclined to drop that part.

> As an initial implementation of this API in the postgres-fdw, I've
> added a new option "updatable" (true by default), which can be
> specified as a server option or as a per-table option, to give user
> control over whether individual foreign tables are read-only or
> updatable.

Do we really want that as a server option? Why?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2013-06-11 21:56:01 Re: request a new feature in fuzzystrmatch
Previous Message Liming Hu 2013-06-11 21:23:26 Re: request a new feature in fuzzystrmatch