Re: creating table while slony-I replication is running - Mailing list pgsql-general

From Shoaib Mir
Subject Re: creating table while slony-I replication is running
Date
Msg-id bf54be870609201810i3d4e079dj19da827c70cbc72f@mail.gmail.com
Whole thread Raw
In response to creating table while slony-I replication is running  (gurkan@resolution.com)
List 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.e attached 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@resolution.com <gurkan@resolution.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@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

pgsql-general by date:

Previous
From: "Merlin Moncure"
Date:
Subject: Re: postgresql rising
Next
From: "Brian Maguire"
Date:
Subject: Postgres Team: Thank You All