Glyn Astill glynastill at yahoo.co.uk
Thu Jul 24 03:50:49 PDT 2008
--- On Wed, 23/7/08, cbbrowne <cbbrowne at ca.afilias.info> wrote:
  
> I'd sorta like to point at something involving looking
> up the table in 
> sl_table, but that requires determining the replication
> schema, which 
> mandates either:
> a) Doing a lookup to find any "sl_table"
> instances (there could be more 
> than one, in principle!), and iterating over them, looking
> to see if the 
> table is listed.  That makes the logic more complex in the
> application.
> b) One could build a stored procedure that uses
> "EXECUTE" to do the 
> logic in a); that eliminates extra round trips.
> 
> I'm not sure that's fundamentally any better than
> the approach you 
> suggest; it's certainly more complex.
> 

Yeah, checking sl_table was actually the first way I thought I should do it, but the idea of having to hunt down sl_table, or as you say multiple instances of sl_table made me think otherwise.

I'm going to tyy the following and see how things go.

select count(*) from (pg_trigger join pg_class on tgrelid=pg_class.oid)
join pg_proc on (tgfoid=pg_proc.oid) join pg_namespace on (relnamespace=pg_namespace.oid)
where (proname = 'denyaccess' or proname = 'logtrigger') and relname = '<table name>' and nspname = '<schema name>';

Thanks
Glyn


      __________________________________________________________
Not happy with your email address?.
Get the one you really want - millions of new email addresses available now at Yahoo! http://uk.docs.yahoo.com/ymail/new.html


More information about the Slony1-general mailing list