Mark Stosberg mark at summersault.com
Mon Dec 8 13:44:26 PST 2008
> Your script would need to do something like:
> 
>   alter table this...
>   alter table that...
>    ... and onwards, for the "cast of 11 tables" ...
> 
> ... then, still as part of the same DDL script being executed by EXECUTE 
> SCRIPT...
>   update "_my_slony_schema".sl_table
>    set tab_relname = (select relname from pg_catalog.pg_class p where 
> oid = tab_reloid);
>   update "_my_slony_schema".sl_sequence
>    set seq_relname = (select relname from pg_catalog.pg_class p where 
> oid = seq_reloid);
> 
> Note this affects sequences *and* tables.

This looks logical to me. However, I was surprised to find that none of
my OIDs lined up for these two tables (with PostgreSQL 8.3.3):

  SELECT oid FROM pg_catalog.pg_class p WHERE relname = 'pets';
  SELECT tab_reloid from _my_schema.sl_table where tab_relname = 'pets';

I reviewed the docs for "pg_class" myself, and it looks to me like your
query would be correct.     

Reference:
http://www.postgresql.org/docs/8.3/static/catalog-pg-class.html

I'm not sure what the missing detail is. 

    Mark




More information about the Slony1-general mailing list