[Bucardo-general] support for primary key column with a sequence as the default value

Omar Mehmood omarmehmood at yahoo.com
Wed Jan 20 01:34:32 UTC 2010


Hi,

I was wondering if Bucardo supports the replication of data in tables whose primary key contains a column with a sequence as the default value.  For example:

CREATE SEQUENCE user_id_sequence START 2147483648;

CREATE TABLE "user"(
 "user_id" Bigint DEFAULT nextval('user_id_sequence') NOT NULL,
 "user_name" Character varying(30) NOT NULL
)
WITH (OIDS=FALSE);

ALTER TABLE "user" ADD CONSTRAINT "user_P1" PRIMARY KEY ("user_id");

INSERT INTO public.user (user_name) VALUES ('omar');

When I test the above setup, Bucardo doesn't seem to replicate the row resulting from the INSERT statement from the master to the slave.  However, the following does work:

CREATE SEQUENCE user_id_sequence START 2147483648;

CREATE TABLE "user"(
 "user_id" Bigint NOT NULL,
 "user_name" Character varying(30) NOT NULL
)
WITH (OIDS=FALSE);

ALTER TABLE "user" ADD CONSTRAINT "user_P1" PRIMARY KEY ("user_id");

INSERT INTO public.user (user_id, user_name) VALUES (nextval('user_id_sequence'), 'omar')

Any ideas ?

Omar


      


More information about the Bucardo-general mailing list