Tuesday, May 13, 2008

Re: [GENERAL] Stripping out slony after / before / during pg_restore?

On Tue, May 13, 2008 at 5:42 PM, Glyn Astill <glynastill@yahoo.co.uk> wrote:
Hi people,

I'm setting us up a separate staging / test server and I want to read in a pg_dump of our current origin stripping out all the slony stuff.

I was thinking this could serve two purposes a) test out backups restore properly and b) provide us with us with the staging / test server

What's the best way to remove all the slony bits?

I was thinking read in the dump, then use uninstall node - but I'd rather not have to run the slon daemons.

Or should I just leave all the slony stuff in there... would it cause us any problems? There'd be no slons running and the next night it's all wiped and restored again...

Anyone got any ideas? Anyone got something similar already?

    You need to have a slon daemon running, configured to monitor the restored database, and the essential settings for this to work are: host name, port-number, database name and the Slony cluster name. Since you do not have a slon daemon for the restored database, I guess you are fine after restoring the database.

    If you really need to be sure that this restored database does not take part in replication, you can go ahead an DROP CASCADE the replication schema from the database. For eg. if your Slony cluster name was my_repl_cluster, then you can connect to the restored database and issue 'DROP SCHEMA _my_repl_cluster CASCADE;' to get rid of the replication information. Now, even if there's a slon daemon running for this DB, it won't be able to do anything; you can eye the slon's log to see the warnings it will generate.

Best regards,

--
gurjeet[.singh]@EnterpriseDB.com
singh.gurjeet@{ gmail | hotmail | indiatimes | yahoo }.com

EnterpriseDB http://www.enterprisedb.com

Mail sent from my BlackLaptop device

No comments: