Re: Tables cannot have INSTEAD OF triggers

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Tables cannot have INSTEAD OF triggers
Дата
Msg-id 20150401172222.GD3071@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: Tables cannot have INSTEAD OF triggers  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
> > On 2015-04-01 12:46:05 -0400, Robert Haas wrote:
> >> So, the idea is that INSTEAD OF would behave like BEFORE but the tuple
> >> it returns wouldn't actually be inserted?  That wasn't clear to me
> >> from the OP, but I guess it would be a reasonable way to go.
> 
> > I'm not sure what the OP intended, but to me that's pretty much the only
> > reasonable definition of INSTEAD OF for tables that I can think of.
> 
> If you have such a trigger, it's impossible to insert any rows, which
> means the table doesn't need storage, which means it may as well be a
> view, no?

The interesting difference, as per upthread, is that you can have child
tables (partitions) and don't need a defining query but instead have a
defined set of named and typed columns.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Tables cannot have INSTEAD OF triggers
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Tables cannot have INSTEAD OF triggers