cbbrowne cbbrowne at ca.afilias.info
Thu Apr 23 07:59:44 PDT 2009
Geoffrey wrote:
> Subject says it.  If I truncate a table on my master, will that be 
> properly handled on the slave?
>
Not particularly, no...

No triggers fire ON TRUNCATE, at least not until PostgreSQL 8.4, which 
isn't really available yet ;-).

With 8.4, there are two possibiliities:

a) We could put a "denyaccess()" function in the ON TRUNCATE method; 
this would lead to consistency, if not complete happiness :-).

b) It is in-principle possible to have the ON TRUNCATE trigger capture 
the table ID, and propagate that event.  Unfortunately, things are 
considerably complicated if there are foreign keys with ON DELETE 
CASCADE, or a request for TRUNCATE foo CASCADE, or for TRUNCATE foo, 
bar, something_not_replicated.

Simon Riggs (who implemented the trigger hook for ON TRUNCATE) generated 
a patch for the simplistic form of b), where we assume we're only coping 
with one TRUNCATE at a time.  No ideas have yet occurred to me for 
coping with several.

But I presume you're not on 8.4, so no, TRUNCATE mayn't work out totally 
well...

-- 
(reverse (concatenate 'string "ofni.sailifa.ac" "@" "enworbbc"))
<http://dba2.int.libertyrms.com/>
Christopher Browne
(416) 673-4124 (land)
"Bother,"  said Pooh,  "Eeyore, ready  two photon  torpedoes  and lock
phasers on the Heffalump, Piglet, meet me in transporter room three"



More information about the Slony1-general mailing list