Re: disabling triggers

Поиск
Список
Период
Сортировка
От weigelt@metux.de
Тема Re: disabling triggers
Дата
Msg-id 20030901175704.GA12947@metux.de
обсуждение исходный текст
Ответ на Re: disabling triggers  (Josh Berkus <josh@agliodbs.com>)
Ответы Re: disabling triggers
Список pgsql-sql
On Tue, Jun 17, 2003 at 11:49:44AM -0700, Josh Berkus wrote:

<big_snip>

I also need something like that for my replication stuff:

When data from another node comes it, it should be written 
directly to the tables, without any (unwanted) triggers firering.

On the other hand, in "normal" mode, also some missing fields
should be filled on create or update.

Perhaps some more details:

All tables have this layout:   inode_id    int4   attr    char   mtime    timestamp   ...   
On INSERT an missing (NULL) inode_id should be taken from sequence
_inode_seq, attr can be set to an default value (currently not important)
and an NULL mtime should be replaced by current_timestamp().

When UPDATE-ing, the mtime should also be set to current_timestamp() 
if not given.


But in the "raw" mode (when data from neighbours come in), the mtime
field may _not_ be touched (since it would produce an loop!).


Currently this is done by the middleware, but I'd like to have it
directly in the RDBMS. How could this be solved ?


regards
-- 
---------------------------------------------------------------------Enrico Weigelt    ==   metux IT services
phone:     +49 36207 519931         www:       http://www.metux.de/     fax:       +49 36207 519932         email:
contact@metux.decellphone:+49 174 7066481         
 
---------------------------------------------------------------------Diese Mail wurde mit UUCP versandt.
http://www.metux.de/uucp/


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

Предыдущее
От: Jan Wieck
Дата:
Сообщение: Re: BEFORE UPDATE Triggers
Следующее
От: weigelt@metux.de
Дата:
Сообщение: Trigger functions w/o pgsql ?