Christopher Browne cbbrowne
Thu Sep 21 15:02:12 PDT 2006
gurkan at resolution.com writes:
> I understood how I am going to create a table to replication. I have posted my
> script
> hoping that it will help to other newbies like me.
>
> My quaestion is now that what happens when I need to do like;
> creating index
> create sequences
> create functions
> create views
> alter table
> etc.
>
> If I do these commands through running 'EXECUTE SCRIPT' with slonik, will it be
> replicated
> on slaves?

Generally, yes, with the following caveats.

There are two problems at present with versions prior to the (soon to
be released) 1.2.0 version:

1.  The script is processed as a single query, which means that if
later DDL statements refer to objects created in earlier statements,
those later statements will fail.

The workaround to this problem is that you must split scripts into
pieces, and submit EXECUTE SCRIPT requests multiple times, once for
each piece.

In 1.2.0, the script is split into individual statements, alleviating
this problem.

2.  The contents of the script are inserted to sl_event with an INSERT
statement using 'quotes'.  If you make any use of 'single quotes',
such as is the case if you assign a default value, this will cause the
EXECUTE SCRIPT to fail (with a complaint about an insert to sl_event).

The only workaround to this at present is to only distribute changes
that do not involve 'quoting.'

In 1.2.0, the script contents are inserted using a prepared statement,
thereby avoiding the need to quote the contents.
-- 
output = reverse("ofni.sailifa.ac" "@" "enworbbc")
<http://dba2.int.libertyrms.com/>
Christopher Browne
(416) 673-4124 (land)



More information about the Slony1-general mailing list