cbbrowne at ca.afilias.info cbbrowne
Tue Oct 12 00:51:31 PDT 2004
> Hello,
> Thankyou very much for prompt reply. And your solution worked too !.
>
> I have further questions if you would like to answer.
>
> 1) Do we absolutely need  to have a primary key in each table which is
> to be replicated ? or will a simple UNIQUE and/or NOT NULL key will be
> enough. Further more, I have few tables in my DB which have fileds which
> act as unique keys (based on sequences) , but they are not defined
> explicitly as PRIMARY or UNIQUE or NOT NULL. Will they suffice for the
> primary key requirements of Slony. Due to reasons that I need to make a
> major adjustment in my entire application (made in VB) because of errors
> come back once a PRIMARY key is violated, I do not want to define such
> fields as primary keys explicitly, though they are of-course serving the
> purpose. In short sentence / other words, we are avoiding duplicate
> entries in such fields programatically.

The only way for Slony-I to recognize that there is a suitable key is if
it is actually defined as a PRIMARY KEY.

If you have candidate primary keys (e.g. - keys that could be used as
primary keys, but which are not identified formally as such), Slony-I will
not automatically detect that.  Look at the docs for SET ADD TABLE; it
allows you to specify an index.

There MUST be a UNIQUE NOT NULL index defined in the database for each table.

What you're trying to do conflicts with how Slony-I works.  It NEEDS to
have either a candidate PK or a genuine one.  For you to simulate one
behind the scenes is not good enough.

> 2) Do we need to run the replicate.sh script, which I refered to in
> previous mail, as cron job ? or is it ok to run it just once during
> system boot time ?

Once replication configuration has been put in place, you don't need to do
it again because the configuration will persist in the tables in the
cluster's replication namespace.

> 3) How can I run slon as daemon ? At the moment I run it on command
> prompt and it just sits idle after showing some messages.

How do you run anything as a daemon?  Usually this involves writing a
wrapper script to invoke the process.  Often people like setting this sort
of thing up in /etc/init.d; your milage may certainly vary.

> 4) What does this message mean ? I see it everytime I run slon
> processes :
>
> PL/pgSQL function "determineattkindserial" line 52 at execute statement

That function is one that is used when a table has no primary key defined,
and therefore Slony-I defines one itself.



More information about the Slony1-general mailing list