Good afternoon,
sql>create table t1 (id SERIAL, PRIMARY KEY(id));
MAPI = [EMAIL PROTECTED]: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 = [EMAIL PROTECTED]: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
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Monetdb-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-developers