From: Ruth Melendo <rmelendo@teltronic.es>
To: 'Greg Spiegelberg' <gspiegelberg@gmail.com>
Cc: 'Technical Doubts' <online.technicaldoubts@gmail.com>
Cc: '[ADMIN]' <pgsql-admin@postgresql.org>
Subject: Re: PostgreSQL with BDR. Problems when adding a sequence in a table column
Date: Mon, 2 Mar 2015 14:27:23 +0100
Message-ID: <002e01d054ec$9e419ea0$dac4dbe0$@teltronic.es> (raw)
In-Reply-To: <CAEtnbpUz8M37f6Gus1vnTy3r-cH4b_q2ohbVNr8_dpjkt8064Q@mail.gmail.com>
References: <001001d054d0$5dcbea40$1963bec0$@teltronic.es>
<CAEtnbpUz8M37f6Gus1vnTy3r-cH4b_q2ohbVNr8_dpjkt8064Q@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>
Hi,
Tried but same error appeared:
ERROR: ALTER TABLE ... ADD COLUMN ... DEFAULT may only affect UNLOGGED or TEMPORARY tables when BDR is active; test_table is a regular table
********** Error **********
I created the sequence using BDR and after that tried to alter table adding the column
CREATE SEQUENCE test_serial_bdr2 USING BDR;
ALTER TABLE test_table add column sec2 INTEGER PRIMARY KEY NOT NULL DEFAULT nextval('test_serial_bdr2');
Ruth Patricia Melendo Ventura
Software Engineer
TELTRONIC, S.A.U.
T: +34 976 465656 Ext. 179
F: +34 976 465722
<http://www.teltronic.es/; www.teltronic.es
Logo40
De: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] En nombre de Greg Spiegelberg
Enviado el: lunes, 02 de marzo de 2015 13:53
Para: Ruth Melendo
CC: Technical Doubts; [ADMIN]
Asunto: Re: [ADMIN] PostgreSQL with BDR. Problems when adding a sequence in a table column
Hi Ruth,
You need to create the sequence first USING BDR then alter the table setting DEFAULT nextval('..._seq').
CREATE SEQUENCE my_id_seq USING BDR;
Make sure your table has a primary key for BDR.
HTH.
-Greg
On Mon, Mar 2, 2015 at 3:05 AM, Ruth Melendo <rmelendo@teltronic.es> wrote:
Hi,
How can I fix this in a database with BDR?
... ALTER TABLE … ADD COLUMN …. DEFAULT may only affect UNLOGGED or TEMPORARY
tables when BDR is active; test_table is a regular table
This error happens when trying to add a column to a table with a sequence.
Thanks in advance!
Ruth Patricia Melendo Ventura
Software Engineer
TELTRONIC, S.A.U.
T: +34 976 465656 <tel:%2B34%20976%20465656%C2%A0%C2%A0%20Ext.%20179> Ext. 179
F: +34 976 465722 <tel:%2B34%20976%20465722>
<http://www.teltronic.es/; www.teltronic.es
Logo40
Attachments:image002.jpg (image/jpeg, 1.6K) downloadview imageimage003.jpg (image/jpeg, 1.6K) downloadview image
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: rmelendo@teltronic.es, gspiegelberg@gmail.com, online.technicaldoubts@gmail.com
Subject: Re: PostgreSQL with BDR. Problems when adding a sequence in a table column
In-Reply-To: <002e01d054ec$9e419ea0$dac4dbe0$@teltronic.es>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox