Re: [9.3] Automatically updatable views vs writable foreign tables

Поиск
Список
Период
Сортировка
От Dean Rasheed
Тема Re: [9.3] Automatically updatable views vs writable foreign tables
Дата
Msg-id CAEZATCW6+hRgk3sOnq9Muewg+MmEtinORPV406BXc4Cp5AwJDw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [9.3] Automatically updatable views vs writable foreign tables  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 13 June 2013 01:11, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Dean Rasheed <dean.a.rasheed@gmail.com> writes:
>> The more I read the spec, the less sense it seems to make, and each
>> time I read it, I seem to reach a different conclusion.
>
>> On my latest reading, I've almost convinced myself that "updatable" is
>> meant to imply support for all 3 operations (INSERT, UPDATE and
>> DELETE), at least in the absence of transient tables. The descriptions
>> of all 3 seem to require the table to be updatable.
>
> Still, they do admit the possibility of insertable_into being different
> from is_updatable.  So I'm pretty happy with what we've got, at least
> on the relation level.  Columns seem a bit more debatable; though I
> continue to think that an is_updatable column in a not-is_updatable
> table isn't contemplated by the spec.
>

Of course if we didn't have rules, this wouldn't be as issue, because
then a view that handled one update operation would handle them all.
The spec doesn't need to worry about that, so it can define the
updatability of a view as a singular concept based on the view's
definition; and insertable_into in terms of the properties of the base
table. In that context, the possibility of an is_updatable column in a
not-is_updatable table doesn't need to be considered.

I don't think that any more reading of the spec is going to help,
because it's simply not as issue that they had to worry about. If the
spec did consider rules, it would probably define rule_insertable,
etc., in the same way as triggers. So our problem is in trying to
shoe-horn rule-updatability into the spec's idea of updatability, and
it doesn't really fit. The more technically correct answer might be to
say that rule-updatable doesn't count as updatable any more than
trigger-updatable does, but that wouldn't be very useful in practice
because there are no columns in the information schema to check for
rule-updatability. So really, I think we're trying to come up with the
most practically useful definition, and in that context I think we've
probably done the right thing at the relation-level, but I still think
that a column could be marked as is_updatable, even if the table
didn't support DELETEs.

That said, I think that this is of such limited interest to anyone
that I'm inclined to simply keep the status quo.

Regards,
Dean



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

Предыдущее
От: Dean Rasheed
Дата:
Сообщение: Re: how to find out whether a view is updatable
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: Parallell Optimizer