Christopher Browne cbbrowne
Wed Dec 29 16:44:53 PST 2004
sarlav kumar wrote:

> Hi All,
>  
> I have some general questions on slony.
>  
> 1) Is it possible to add a composite key for a table(which does not 
> have any PK) through the slonik scripts?

You could use "execute sql" to run a separate SQL script to introduce a 
composite Candidate Primary Key.  Slonik hasn't any way to do this 
explicitly, though.

> 2) If the master and slave DB are on different machines, is 
> replication done on the master machine or the slave machine ? Or can 
> it be done on either of them?

There is no "master"; there is no "slave;" there are just nodes.

Replication work is performed on each of the nodes, and might even take 
place on different machine altogether.  After all, I might want to run 
all of the slon daemons on a separate machine.

> 3) Is there a specific port for the slon daemons to run/listen on?
>    In some examples I saw 5432 being used. Is that the port number?

Port 5432 is the "default port" that PostgreSQL instances listen on if 
you run an installation based on "out of the box" configuration.

Slon daemons do not "run on" or "listen on" any port at all; they simply 
connect to whatever port your databases are running on.

> 4) When the replicated database(slave) goes down, what happens to the 
> data changes in the master? Is it logged somewhere? How much data can 
> be logged?

Updates are logged in _[clustername].sl_log_1 and 
_[clustername].sl_seqlog.  You could log fairly preposterous amounts of 
data, which might lead to it taking preposterously long for subscriber 
nodes to catch up.

Again, you're using the terms "master" and "slave," which do not 
accurately describe what is going on.  "Provider" and "subscriber" are 
the accurate terms.

> 5) I replicated pgbench database and then I added a new table to the 
> pgbench database. I would like to add this table to the replication 
> set and replicate it to pgbenchslave. The first set of tables I 
> replicated was added to set 1. Is it possible to add the new table to 
> set 1 directly, or do I have to add the new table to a new set(say 2) 
> and then merge it to the old set(set 1)? Also, while specifying the 
> slonik scripts for the replicating the new table, what other 
> information is required(like the cluster name etc)?

You will need to create a new set (say #2), add the new table to that 
new set, and once the sets have an identical set of providers and 
subscribers, you may merge the sets together.


More information about the Slony1-general mailing list