Re: Deprecating RULES

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: Deprecating RULES
Дата
Msg-id 507EF539.3060202@agliodbs.com
обсуждение исходный текст
Ответ на Re: Deprecating RULES  (Greg Stark <stark@mit.edu>)
Список pgsql-hackers
Greg,

> Warning: RULES are tricky to use correctly. They rewrite the original
> query into a new query before it is run and it is very hard to
> correctly anticipate and rewrite every possible input query into the
> desired result. There are also unexpected interactions with other
> components when RULES do something unexpected such as rewrite a single
> query to return two result sets.
> 
> For most applications it's much simpler and more predictable to use
> TRIGGERs. ROW level triggers are evaluated for each row the original
> query is about to process (or has just finished processing) and this
> makes them much easier to follow. Statement level TRIGGERs can be used
> for audit logs and similar operations which need to run once per
> statement.

This is excellent.  However, if we are actually considerting deprecating
them, we should add the sentence "RULEs may be deprecated in a future
release of PostgreSQL."


-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com



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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: Deprecating RULES
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Deprecating RULES