Tue Dec 9 13:28:51 PST 2008
- Previous message: [Slony1-general] Re: Best Practices for renaming tables in Slony?
- Next message: [Slony1-general] Re: Best Practices for renaming tables in Slony?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Mon, 8 Dec 2008 16:44:26 -0500 Mark Stosberg <mark at summersault.com> wrote: > > 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. This was a development setup, and it turned out we needed to run "REPAIR CONFIG". After that, the OIDs lined up again. Mark
- Previous message: [Slony1-general] Re: Best Practices for renaming tables in Slony?
- Next message: [Slony1-general] Re: Best Practices for renaming tables in Slony?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-general mailing list