Search Postgresql Archives

ALTER TABLE to ADD BDR global sequence

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



While attempting to alter a table to add a global sequence as a primary key using the following commands:

 

CREATE SEQUENCE my_table_id_seq USING bdr;

ALTER TABLE my_table

ADD COLUMN id integer PRIMARY KEY NOT NULL DEFAULT nextval('my_table_id_seq'::regclass);

 

I started to notice some issues that concerned me. In order to create the sequence, I had to have the replication running. To alter the table, I had to stop replication. The only way I really knew how to do this was to remove the bdr properties in the postgres configuration file and restart. At that point, I executed the ALTER TABLE code, when it got to 15000 records, Postgres informed me that I needed to turn replication back on so the nodes could agree on additional sequence allocations. When I turned it back on, it just kind-of wigged out.

 

So, how is this supposed to work? In addition, what happens when you have very disparate databases that are both updated often and connected occasionally (which is what we have). Will it quit doing inserts until it is connected to the other databases again? That would be really bad.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux