Mammoth
  • |
  • Contact
  • |
CMD | Command Prompt, Inc. - PostgreSQL Solutions, Support & Hosting
  • |
  • |
  • |
  • |
  • |

PostgreSQL + Replication

General Replicator Information

Can I use the Open Source version of PostgreSQL with your product?
Mammoth PostgreSQL + Replication IS the Open Source version of PostgreSQL. It just has Replication integrated within the backend.

Replicator Installation / Configuration

How do I know which tables need primary keys?
If you are unsure of which tables will need primary keys here is some SQL to help you.
SELECT nspname, relname 
   FROM pg_class 
   LEFT JOIN pg_constraint ON 
      (pg_constraint.contype = 'p' AND conrelid = pg_class.oid)
   JOIN pg_namespace ON 
      (pg_namespace.oid = pg_class.relnamespace)
   WHERE relkind = 'r' AND contype IS NULL;
How many tables can Replicator replicate?
The official answer is 10,000 tables. However there are a couple of caveats:

  1. The replicated_table_names list is scanned at the start of each connection thus if you have 10,000 tables listed there is a good chance that the connection will timeout before the backend recognizes that it is available.
  2. The replicated_table_names list uses shared memory.


I added a table and it won't replicate!
Make sure you have checked the following:

  1. The table structure exists on the slave.
  2. You have issued the following commands:
    ALTER TABLE foo ENABLE REPLICATION;
    ALTER TABLE foo ENABLE REPLICATION ON SLAVE 0;
    
    Where foo is the table name and SLAVE 0 is the number of the slave you wish to replicate to.

Replicator Management

How can I tell the Slave that it is already synced with the Master?
You have restored the Slave from a backup from the Master. There have been zero updates to the Master since the restoration of the Slave and you want to only replicate from the point in which you restored the backup.

This is currently not possible with Replicator. Replicator requires full knowledge of the database thus it will truncate your slave and replicate from the master.
How do I make changes to the schema once replication is running?
There is a now a section in the documentation that covers this.
Promote Features
There is now a section in the docs on this tip.

Copyright © 2000-2010 Command Prompt, Inc. All Rights Reserved. All trademarks property of their respective owners.