cbbrowne at ca.afilias.info cbbrowne
Tue Nov 21 07:43:22 PST 2006
>
> I have a cluster in production that has a handfull of tables with slony
> generated primary keys that I'm thinking of removing and replacing with
> non-slony ones (The tables belong to a third party application, we
> initially
> wanted to just replicate the data without changing the tables)
>
> What is the best way to do this to minimize locking/downtime.
>
> Options I see include:
>
> 1. Removing the tables from the replication set, altering them, re-adding
> them.
> 2. Alter  the tables, and somehow tell slony about the new primary key
> (Can
> I do this? If so how?)
> 3. Anything else?

I'd be inclined to go with #1, to do a SET DROP TABLE, alter the table,
then add it back to replication.

That's the "obvious" way that will work.

Fiddling with things so as to change primary keys via some "magic" would
be interesting; not overly safe, to my mind...

In principle, a simple "execute script" where you drop the old index and
create a new one under the same name ought to "do the trick."

Regrettably, it's still risky.  The risk is that if you drop replication,
that index would get dropped, possibly breaking things :-(.




More information about the Slony1-general mailing list