Fri Jul 22 10:44:51 PDT 2011
- Previous message: [Slony1-general] Is it possible to add slony to an existing DB (imported from old-slony-server)?
- Next message: [Slony1-general] Is it possible to add slony to an existing DB (imported from old-slony-server)?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hello Christopher, thanks a lot for replying. Of course this is a configuration issue and the user (me) is the source of all evil. But I am really new to slony and therefore I am asking a lot. One thing that bothers me is that the old server I am trying to "copy" runs slony and everything works as expected. But I can't find any of the mentioned tables there, like "history" or "pgbench_history" etc. On the new server there were "pgbench_history", "pgbench_branches", "pgbench_tellers", "pgbench_accounts", but all in the public schema. And I got this notice: NOTICE: table "pgbench_branches" does not exist, skipping NOTICE: table "pgbench_tellers" does not exist, skipping NOTICE: table "pgbench_accounts" does not exist, skipping NOTICE: table "pgbench_history" does not exist, skipping So why is slony working on the other (old) server, which does not seem to have any of the four tables mentioned above? Is that even possible? Are the tables "invisible" or am I too unexperienced to find them? After dropping the two databases and starting from scratch I was even able to start the master slon. Only an error when starting the slave remained. But now, after rebooting, I can't even start the master anymore: /etc/init.d/slony-I_fquest_master start -> failed cat /var/log/slony-I/master_fquest.log: ... 2011-07-22 19:08:44 CESTFATAL Cannot open pid_file "/var/log/slony-I/master_slon.pid" ... This is now a bit off topic, but feel free to help me out. Kind regards, Marcus Christopher Browne-5 wrote: > > On Fri, Jul 22, 2011 at 11:37 AM, marmu <mu at forsa.de> wrote: >> >> Hello Guillaume, >> >> ok, that was my mistake. but now I altered the psql command accordingly >> and >> this is the output: >> >> fquest-b1:~ # psql -U $PGBENCHUSER -h localhost -d $MASTERDBNAME -c >> "begin; >> alter table pgbench_history add column id serial; update pgbench_history >> set >> id = >> nextval('history_id_seq'); alter table pgbench_history add primary >> key(id); >> commit"; >> NOTICE: ALTER TABLE will create implicit sequence >> "pgbench_history_id_seq" >> for serial column "pgbench_history.id" >> ERROR: relation "history_id_seq" does not exist >> LINE 2: nextval('history_id_seq'); alter table pgbench_history add p... >> ^ >> fquest-b1:~ # psql -U $PGBENCHUSER -h localhost -d $MASTERDBNAME -c >> "begin;update pgbench_history set id = nextval('pgbench_history_id_seq'); >> alter table pgbench_history add primary key(id); commit"; >> ERROR: relation "pgbench_history_id_seq" does not exist >> LINE 1: begin;update pgbench_history set id = nextval('pgbench_histo... >> >> I really don't get it. Where should the relation "pgbench_history_id_seq" >> come from, do I have to create everything manually? Slony is kind of a >> pain >> in the ass for novices like me, excuse my language. >> My colleage says, "but when it is finally running, it is solid as a rock >> and >> amazingly fast". I'd like to experience that soon :) > > This isn't notably a Slony issue, except insofar as the Slony > documentation describes how pgbench *used* to work, rather than what > it got changed to more recently. > > Understanding what's going on is a lot more important than getting a > recipe, because when PostgreSQL or pgbench change, that means the > recipe may need to change, and that is indeed what happened. > > Slony requires that all replicated tables have a primary key defined. > The pgbench "history" table doesn't have one of those by default, so, > to replicate the pgbench schema requires adding a primary key to that > table. > > On older versions of pgbench, what was necessary was to run a query like: > alter table history add column id serial; > alter table history add primary key(id); > > And then add the sequence that gets generated for that ID column to > replication. > > On newer versions of pgbench, the tables have the prefix "pgbench_" > prepended to them, thereby changing the queries to: > alter table pgbench_history add column id serial; > alter table pgbench_history add primary key (id); > > Since the names of the tables and sequences have all changed, the > Slony configuration needs to account for the new names. Nobody > updated the documentation, so I have done so. > > <http://git.postgresql.org/gitweb/?p=slony1-engine.git;a=commit;h=928300d1fc0078d2e980aa3f601c351c12495d8a> > _______________________________________________ > Slony1-general mailing list > Slony1-general at lists.slony.info > http://lists.slony.info/mailman/listinfo/slony1-general > > -- View this message in context: http://old.nabble.com/Is-it-possible-to-add-slony-to-an-existing-DB-%28imported-from-old-slony-server%29--tp32092506p32117157.html Sent from the Slony-I -- General mailing list archive at Nabble.com.
- Previous message: [Slony1-general] Is it possible to add slony to an existing DB (imported from old-slony-server)?
- Next message: [Slony1-general] Is it possible to add slony to an existing DB (imported from old-slony-server)?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-general mailing list