[postgres-xl-bugs] data not inserts in table with sequence

Yandex Mail pyankovv-v at yandex.ru
Tue Nov 13 08:25:41 PST 2018


Hello
Cannot insert data into table with sequence.
Record inserted only in last strange test.
Is this problem of my installation?
3 datanodes, 2 coordinators, gtm (no slave), gtmproxy on each datanode.

On version 9.5 all OK.	

Thank you!

select version()
PostgreSQL 10.5 (Postgres-XL 10r1) on x86_64-pc-linux-gnu, compiled by gcc
(Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609, 64-bit

Compiled:
su postgres -c "./configure   --with-openssl --with-libxml --with-libxslt
--prefix=$PGINSTALL --disable-rpath"
make
make install  
cd /cluster/install/postgres-xl-$VERPGSL/contrib/pgxc_ctl
make install 


--STEPS TO REPRODUCE
---------------------------
--s BIGSERIAL PRIMARY KEY
drop table if exists test1;
create table test1 (s BIGSERIAL PRIMARY KEY,t varchar);
insert into test1(t) values ('qwe') returning s;
--no error, nothing returned
select count(*) from test1;
--0
insert into test1(s,t) values (nextval('test1_s_seq'),'qwe') returning s;
--no error, nothing returned
select count(*) from test1;
--0
insert into test1(s,t) values ((select nextval('test1_s_seq')),'qwe')
returning s;
--no error, nothing returned
select count(*) from test1;
--0

-----------------------
--s bigint not null default  nextval('test2_s_seq')
drop sequence if exists test2_s_seq;
drop table if exists test2;

create sequence test2_s_seq;
create table test2 (s bigint not null default  nextval('test2_s_seq')
PRIMARY KEY,t varchar);
insert into test2(t) values ('qwe') returning s;
--no error, nothing returned
select count(*) from test2;
--0
insert into test2(s,t) values ((select nextval('test2_s_seq')),'qwe')
returning s;
--no error, nothing returned
select count(*) from test2;
--0

-----------------------
--s bigint and t is not null unique
drop sequence if exists test4_s_seq;
drop table if exists test4;

create sequence test4_s_seq;
create table test4 (s bigint not null   PRIMARY KEY,t varchar not null
UNIQUE);
insert into test4(s,t) values (nextval('test4_s_seq'),'qwe') returning s;
--no error, nothing returned

insert into test4(s,t) values ((select nextval('test4_s_seq')),'qwe')
returning s;
--WORKS - INSERTED ID RETURNED
select count(*) from test4;
--1




More information about the postgres-xl-bugs mailing list