Jan Wieck JanWieck
Mon Jan 3 17:14:53 PST 2005
On 12/27/2004 4:50 PM, Vivek Khera wrote:
> For setting up the initial replication, we use "pg_dump -s" to get the 
> schema dump to install into the client.  Then slony installs its own 
> schema and triggers when the cluster is configured and subscribed.
> 
> So, now, what does one use to get the schema for adding another node?

That's one that bothered me for a while too. I added the attached shell 
script to -HEAD, but it works for 1.0.5 as well.

It is called as

     slony1_extract_schema.sh dbname clustername tempdbname

It only works correct when dbname is the "origin" of the sets, and will 
output a warning for all sets not originating on that database. It will 
extract the schema and the Slony config data from that database. The 
creates a temporary database named $tempdbname, load that schema and 
data extract into it. Then it invokes slonik to "uninstall node" on that 
temp DB and finally dumps the resulting schema to stdout ... which is 
what one would get if one does an uninstall node on the "master" and 
then a schema only dump.


Jan

> 
> Using "pg_dump -s --schema=public" still leaves the slony logging 
> triggers and some other stuff.
> 
> I don't see anything in the admin docs regarding this, nor how to take 
> a dump that can be safely restored elsewhere.
> 
> My immediate problem is that I want to test on my development cluster 
> some schema changes, but I want to start with the exact schema 
> currently on the production box to ensure that the EXECUTE SCRIPT won't 
> fail and cause me major headaches.
> 
> _______________________________________________
> Slony1-general mailing list
> Slony1-general at gborg.postgresql.org
> http://gborg.postgresql.org/mailman/listinfo/slony1-general


-- 
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck at Yahoo.com #
-------------- next part --------------
A non-text attachment was scrubbed...
Name: slony1_extract_schema.zip
Type: application/x-zip-compressed
Size: 1137 bytes
Desc: not available
Url : http://gborg.postgresql.org/pipermail/slony1-general/attachments/20050103/b6b6150c/slony1_extract_schema.bin


More information about the Slony1-general mailing list