[Bucardo-general] Possible bug?

Greg Sabino Mullane greg at endpoint.com
Thu May 16 16:28:40 UTC 2013


On Tue, May 14, 2013 at 10:17:40AM +0200, Olaf Rühenbeck wrote:
> 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:

A onetimecopy=1 will not remove the need for a primary key. Also keep in mind 
that a primary key is not strictly needed - just a unique index (which is all 
a primary key really is).

> # 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.

Are you sure the new primary key is on all databases?

As Adam points out, the primary key information is added to the internal 
Bucardo tables when the table is first added. You may be able to do it 
on the fly, but make sure that all the pkey related fields get updated! 
To view things:

bucardo list table foobar -vv

Then to update the pkey field:

bucardo update table foobar pkey=id

-- 
Greg Sabino Mullane greg at endpoint.com
End Point Corporation
PGP Key: 0x14964AC8
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 163 bytes
Desc: Digital signature
URL: <https://mail.endcrypt.com/pipermail/bucardo-general/attachments/20130516/cc31c9b1/attachment.sig>


More information about the Bucardo-general mailing list