[Monetdb-developers] SERIAL column,
Good afternoon, sql>create table t1 (id SERIAL, PRIMARY KEY(id)); MAPI = monetdb@localhost:50000 QUERY = create table t1 (id SERIAL, PRIMARY KEY(id)); ERROR = !CONSTRAINT PRIMARY KEY: a table can have only one PRIMARY KEY sql>create table t1 (id SERIAL); sql>insert into t1 values(5); [ 1 ] sql>insert into t1; [ 1 ] sql>insert into t1; [ 1 ] sql>insert into t1; [ 1 ] sql>insert into t1; [ 1 ] sql>insert into t1; MAPI = monetdb@localhost:50000 QUERY = insert into t1; ERROR = !SQLException:assert:INSERT INTO: PRIMARY KEY constraint 't1.t1_id_pkey' violated sql> The constraint check is correct, but should the first insertion be allowed? I checked the parser to know what SERIAL means: | column SERIAL { /* SERIAL = INTEGER GENERATED ALWAYS AS IDENTITY PRIMARY KEY */ Then I check what means GENERATED ALWAYS means: http://troels.arvin.dk/db/rdbms/#mix-identity "When ALWAYS is specified, the user cannot specify a value for the column which means that the DBMS can guarantee successful insertion of a unique value on each table insert." Who is right? The web-page or MonetDB? I tried to find something in the standard book and nothing (maybe I did not check correctly). Regards, Romulo
participants (1)
-
Romulo Goncalves