Re: Rules and Command Status - update/insert/delete rule with series of commands in action

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: Rules and Command Status - update/insert/delete rule with series of commands in action
Дата
Msg-id 72867dad-25b3-4bf1-a4e2-b739f9bffb72@aklaver.com
обсуждение исходный текст
Ответ на Re: Rules and Command Status - update/insert/delete rule with series of commands in action  ("johnlumby@hotmail.com" <johnlumby@hotmail.com>)
Список pgsql-general
On 5/30/24 15:34, johnlumby@hotmail.com wrote:
> 
> On 5/30/24 4:56 PM, David G. Johnston wrote:
>>
>> Very little interest exists in working on user-specified rules.  They 
>> are practically deprecated.
> 
> 
> Ah  -   pity  -   see my last comment to Adrian's
> 
> 
>>
>>     Any interest in perhaps providing a choice via a configuration
>>     parameter?
>>
>>
>>  If anything is done it would have to be new syntax.
>>
>>
> A much bigger task surely.
> 
> 
> On 5/30/24 5:19 PM, Adrian Klaver wrote:
>>
>> 2) Use INSTEAD OF triggers:
>>
>>
> 
> Unfortunately the same functionality as in my example with the RULE is 
> not supported for triggers on views :   from the manual
> 
> |INSTEAD OF| triggers may only be defined on views, *and only at row level*;
> 
> 
> A RULE is essentially a statement-level operation which is what I need 
> for this particular case.      A row-level trigger would not work 
> because it cannot "see" the query causing it to be fired, and also ,  
> (most importantly) is not fired at all if no rows match the original 
> query,     whereas a RULE is always in effect regardless of which rows 
> are involved. before.      I should add that the RULE I showed in my 
> example is not the only RULE being used on this view  -    there are 
> other conditional RULEs,   and the combined effect is of being able to 
> change the effect of the original statement into a set of new 
> statements,   one of which does what is needed.
> 

Basically don't give the user what they asked for, give them some 
cobbled together  on the fly version. Who decides that what the user 
needs? Seems to me this the point at which to have a discussion with the 
application developers about having the application asking the correct 
questions, rather then going down the road of bait and switch.


> 
> And if you are now inclined to say "well,    maybe the application 
> itself is poorly written and should be changed"  -   I would have to 
> agree,    but that is not mine to change.

> 
> 
> But I suppose that my next question,   given what you both say about the 
> RULE system being a dead-end,  is whether there is any likelihood of 
> supporting an INSTEAD OF trigger on a view at statement level?   Maybe 
> that stands more chance of going somewhere?
> 
> 
> 
> Cheers,     John Lumby
> 
> 

-- 
Adrian Klaver
adrian.klaver@aklaver.com




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

Предыдущее
От: Alanoly Andrews
Дата:
Сообщение: Re: ERROR: found xmin from before relfrozenxid; MultiXactid does no longer exist -- apparent wraparound
Следующее
От: Timo Schwaak
Дата:
Сообщение: Issue with PostgreSQL Installer on Windows and Special Characters in the superuser password