Bucardo

Last updated: 2020-02-28

The add dbgroup command creates a database group and optionally adds one or more databases to it.

Example:

bucardo add dbgroup horses A B C

Creates a new database group named horses and puts the databases A, B, and C inside of it. The default roles are used, so database A in this group will be a source database, and B and C will be targets.

Usages:

bucardo add dbgroup <name> [optional list of databases]

The list of databases is optional, and can include the type of role as well. By default, the first database given is set to a source role, and the others are set to a target role. The role can be specified by adding a colon and then the role name afterwards. Thus, this command is the same as the example above:

bucardo add dbgroup horses A:source B:target C:target

The roles are “source”, “target”, or “fullcopy”. The data is going to flow from the “source” database to the “target” or “fullcopy” database.

“fullcopy” role allows entire tables from the “source” to be copied. Any rows on the “fullcopy” databases are removed first, and the tables are populated using the COPY command. This mode is useful for tables that have no primary key or unique index. Because it copies the entire tables every time, it is not efficient and should not be used for large tables. It is better on most cases to a unique index to the table and use the “target” role.

You can also add new databases to a group with the add dbgroup command. Databases can only be added this way: they are never removed from the group. For example, to add a new database to the same group with a role of fullcopy, use:

bucardo add dbgroup horses D:fullcopy

Internals

New database groups are created with an insert to the dbgroup table. Databases that are added to this group cause an insert to the dbmap table.

See also:

Bucardo.org is hosted and supported by End Point Dev

End Point Dev logo

Need assistance with Bucardo?

End Point Dev offers professional support for Bucardo, as well as specializing in developing, designing, and marketing effective websites. Since 1995, our diverse team of developers has shown that End Point can handle your organization’s greatest web and database challenges.