Re: Return of INSTEAD rules

Поиск
Список
Период
Сортировка
От Manfred Koizar
Тема Re: Return of INSTEAD rules
Дата
Msg-id qgcrpushkpisdpu8n0ivhllbbs0p2haiai@4ax.com
обсуждение исходный текст
Ответ на Return of INSTEAD rules  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: Return of INSTEAD rules  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-hackers
On Thu, 3 Oct 2002 22:21:27 -0400 (EDT), Bruce Momjian
<pgman@candle.pha.pa.us> wrote:
>so I propose we handle
>INSTEAD rules this way:  that we return the oid and tuple count of the
>last INSTEAD rule query with a tag matching the main query.  

Bruce, this won't work for this example

>>     CREATE RULE visible_delete AS     -- DELETE rule
>>     ON DELETE TO visible 
>>     DO INSTEAD 
>>         COUNT UPDATE table3
>>         SET deleted = 1
>>         WHERE pk = old.pk;

because here we don't have a rule query with a matching tag.  Same
applies for

>>     CREATE RULE v_update AS     -- UPDATE rule
>>     ON UPDATE TO v 
>>     DO INSTEAD NOTHING;

I wrote:
>> One argument against automatically "don't count non-INSTEAD rules and
>> count the last statement in INSTEAD rules"

Seems I introduced a little bit of confusion here by argueing against
something that has never been proposed before.  Funny, that this
non-existent proposal is now seriously discussed :-(

Has the idea of extending the syntax to explicitly mark queries as
COUNTed already been rejected?  If yes, I cannot help here.  If no, I
keep telling you that this approach can emulate most of the other
possible solutions still under discussion.

Bruce wrote:
>If there is more than one matching tag in
>the INSTEAD rule, the user has the option to place the query he wants
>for the return at the end of the rule.

Are you sure this is always possible without unwanted side effects?

ServusManfred


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

Предыдущее
От: "Michael Paesold"
Дата:
Сообщение: Re: CURRENT_TIMESTAMP
Следующее
От: "Curtis Faith"
Дата:
Сообщение: Re: Potential Large Performance Gain in WAL synching