Re: creating table while slony-I replication is running

From: "Shoaib Mir" <shoaibmir(at)gmail(dot)com>
To: "gurkan(at)resolution(dot)com" <gurkan(at)resolution(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: creating table while slony-I replication is running
Date: 2006-09-21 01:10:45
Message-ID: bf54be870609201810i3d4e079dj19da827c70cbc72f@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Gurkan,

I just tried the same but didn't face a problem while doing so.

You can try the same steps that I did:

1. Made a exec_scr file for Slonik with execute script command
(i.eattached with the email)
2. Made a test.sql file which has the create table just like the one you
mentioned (i.e attached with the email)
3. Now using Slonik executed the script test.sql for master and salve like
this

/opt/EnterpriseDB/8.1.4.17/dbserver/slonik exec_scr

and that created the same table on the master and respective slave node.

The encoding error that you are getting might be due to some extra or some
special hidden characters in one of your script files.

Please try using the script files that I have attached with the email and
following the steps given above.

Thanks,
--
Shoaib Mir
EnterpriseDB (www.enterprisedb.com)

On 9/21/06, gurkan(at)resolution(dot)com <gurkan(at)resolution(dot)com> wrote:
>
> Hi,
> I am trying to find out how to CREATE a table while Slony-I replication is
> running (meaning without stopping Slony-I replication adding/creating new
> table
> into replication)
>
> I have tried to run this but wont work. please help. thanks.
>
> add_table.sh
> ----------------------------
> #!/bin/sh
>
> /opt/EnterpriseDB/8.1.4.17/dbserver/bin/slonik <<_EOF_
> #--
> # define the namespace the replication system uses in our example
> it is
> # slony_example
> #--
> cluster name = $CLUSTERNAME;
>
> node 1 admin conninfo = 'dbname=$MASTERDBNAME host=$MASTERHOST
> port=$MASTERDBPORT user=$REPLICATIONUSER';
>
> EXECUTE SCRIPT (
> SET ID = 1,
> FILENAME =
> '/opt/EnterpriseDB/8.1.4.17/dbserver/bin/add_table.sql',
> EVENT NODE = 1
> );
>
> _EOF_
> ----------------------------------
>
> add_table.sql
> ----------------------------------
> CREATE TABLE gurkan
> (
> id serial not null ,
> fname varchar(155),
> lname varchar(155),
> primary key (id)
> );
> ----------------------------------
>
> ERROR:
> -------------------------
> [enterprisedb(at)baba1 bin]$ ./add_table.sh
> <stdin>:9: PGRES_FATAL_ERROR select
> "_edb_replication_example".ddlScript(1,
> 'CREATE TABLE gurkan
> (
> id serial not null ,
> fname varchar(155),
> lname varchar(155),
> primary key (id)
> );
> X\uffff\uffff', -1); - ERROR: invalid byte sequence for encoding
> "UNICODE": 0xc1c4
> -------------------------
> -------------------------
>
>
> -------------------------------------------------
> This mail sent through IMP: www.resolution.com
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match
>

Attachment Content-Type Size
exec_scr application/octet-stream 263 bytes
test.sql text/x-sql 102 bytes

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Christopher Browne 2006-09-21 01:27:22 Re: creating table while slony-I replication is running
Previous Message Merlin Moncure 2006-09-21 00:57:57 Re: postgresql rising