Обсуждение: views

Поиск
Список
Период
Сортировка

views

От
Andrzej Barszcz
Дата:
Dear hackers,

I would be happy when checkRuleResultList in rewriteDefine.c lost so strict conditions for returning clause. Are there any reasons to have such restriction for views ?
What I mean in short:

 create view ... as select MAIN_TABLE ... joins ...

1. Updating view means updating MAIN_TABLE
2. I want to return after insert at least primary key

No rule system, no trigger INSTEAD OF give me such possibility but I know that it's possible after modification of checkRuleResultList.



Re: views

От
Tom Lane
Дата:
Andrzej Barszcz <abusinf@gmail.com> writes:
> I would be happy when checkRuleResultList in rewriteDefine.c lost so strict
> conditions for returning clause. Are there any reasons to have such
> restriction for views ?

Uh, so that the results of a query that invokes the rule are well-defined?

If you think that for your application, it's okay for the RETURNING rule
to not bother providing useful data for some columns, you could just have
it return nulls for those.  But I don't think it's appropriate for the
system itself to make a value judgement like that.  If the columns don't
match up, it could very well be user error, and we should report that.

            regards, tom lane