[9.3] Automatically updatable views vs writable foreign tables

Поиск
Список
Период
Сортировка
От Dean Rasheed
Тема [9.3] Automatically updatable views vs writable foreign tables
Дата
Msg-id CAEZATCXi3yYomexaQqPapF++oBc4i-GwUD_hB4aAVbU4eGkA7Q@mail.gmail.com
обсуждение исходный текст
Ответы Re: [9.3] Automatically updatable views vs writable foreign tables  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi,

I've just started 9.3 beta testing and I noticed that a "simple" view
defined on top of a writable foreign table is not automatically
updatable.

Given that these are both new-to-9.3 features, I think it would be a
shame if they don't work together. It's basically a 1-line patch to
make such views automatically updatable, plus a small extra code block
in relation_is_updatable() to reflect the change in the
information_schema views.

The attached patch does that and adds a couple of extra regression tests.


The tests, however, reveal a separate issue with writable foreign
tables --- the information_schema views haven't been updated to
reflect the fact that foreign tables may now be updatable.
Specifically, for foreign tables
information_schema.tables.is_insertable_into and
information_schema.columns.is_updatable always say 'NO' even if the
foreign table is writable. Fixing that would require new C functions
along the same lines as pg_view_is_insertable/updatable(), or those
functions could just be renamed and repurposed to do the check for all
relation kinds, except those known to be always/never updatable.

Regards,
Dean

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: Better handling of archive_command problems
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [9.3] Automatically updatable views vs writable foreign tables