pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: weigelt@metux.de
To: pgsql-sql@postgresql.org
Subject: Re: disabling triggers
Date: Mon, 1 Sep 2003 19:57:04 +0200
Message-ID: <20030901175704.GA12947@metux.de> (raw)
In-Reply-To: <200306171149.44425.josh@agliodbs.com>
References: <1164.219.65.230.103.1055871254.squirrel@mail.trade-india.com>
	<200306171131.24578.josh@agliodbs.com>
	<1182.219.65.230.103.1055875666.squirrel@mail.trade-india.com>
	<200306171149.44425.josh@agliodbs.com>

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.de
 cellphone: +49 174 7066481	     
---------------------------------------------------------------------
 Diese Mail wurde mit UUCP versandt.      http://www.metux.de/uucp/



view thread (8+ messages)  latest in thread

Message-ID: <20030901175704.GA12947@metux.de>
Permalink:  ../20030901175704.GA12947@metux.de/
Also on:    postgresql.org/message-id/20030901175704.GA12947@metux.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: weigelt@metux.de
  Subject: Re: disabling triggers
  In-Reply-To: <20030901175704.GA12947@metux.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox