Hi, Try to remove table then add table once again and add sync. #bucardo_ctl remove table ... #bucardo_ctl add table … #bucardo_ctl add sync ...
I can't check right now, but bucardo probable gather information about tables while adding tables... /Adam 2013/5/14 Olaf Rühenbeck <[email protected]>: > Hey there, > > I try to use bucardo do replicate a few databases between 2 hosts to have a > always up to date backup copy of our database in another host. In this case > the bacula director catalog database. > > I try to add a sync: > > # bucardo add sync m_baculadir_v herd=maguro dbs=maguro onetimecopy=2 > > and get: > > Failed to add sync: DBD::Pg::st execute failed: ERROR: Table > "public.jobhisto" must specify a primary key! at line 117. at line 30. > CONTEXT: PL/Perl function "validate_sync" at /usr/bin/bucardo line 4113. > > As its the first sync I used onetimecopy=2 to get the target database fully > populated. > > I read in the archives of this list that bucardo always requires a primary > key on every table it tries to sync, this is kinda annoying and I will have > to write a script to take care of this after every major bacula database > schema upgrade, but also if I try to set onetimecopy=1 to avoid the > necessity of the primary key it comes up with the same message. So I added a > primary key to the table in the source database and I still get the same > error: > > > baculadir=# alter table jobhisto add primary key (jobid); > NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index > "jobhisto_pkey" for table "jobhisto" > ALTER TABLE > baculadir=# \d jobhisto > Table "public.jobhisto" > Column | Type | Modifiers > -----------------+-----------------------------+----------- > jobid | integer | not null > job | text | not null > name | text | not null > type | character(1) | not null > level | character(1) | not null > clientid | integer | > jobstatus | character(1) | not null > schedtime | timestamp without time zone | > starttime | timestamp without time zone | > endtime | timestamp without time zone | > realendtime | timestamp without time zone | > jobtdate | bigint | > volsessionid | integer | > volsessiontime | integer | > jobfiles | integer | > jobbytes | bigint | > readbytes | bigint | > joberrors | integer | > jobmissingfiles | integer | > poolid | integer | > filesetid | integer | > priorjobid | integer | > purgedfiles | smallint | > hasbase | smallint | > hascache | smallint | > reviewed | smallint | > comment | text | > Indexes: > "jobhisto_pkey" PRIMARY KEY, btree (jobid) > "jobhisto_idx" btree (starttime) > > baculadir=# \q > > And still get the same error: > > # bucardo add sync m_baculadir_v herd=maguro dbs=maguro onetimecopy=1 > Failed to add sync: DBD::Pg::st execute failed: ERROR: Table > "public.jobhisto" must specify a primary key! at line 117. at line 30. > CONTEXT: PL/Perl function "validate_sync" at /usr/bin/bucardo line 4113. > > Any ideas on this? Would appreciate some help :) > > thanks, > > Olaf > > _______________________________________________ > Bucardo-general mailing list > [email protected] > https://mail.endcrypt.com/mailman/listinfo/bucardo-general > _______________________________________________ Bucardo-general mailing list [email protected] https://mail.endcrypt.com/mailman/listinfo/bucardo-general
