On 18-08-2009 16:00:07 -0400, Matthew Jones wrote:
After creating a table with a 'serial' type id field I noticed this when describing it: sql>CREATE TABLE "schtest"."testt" ("id" serial, ... sql>\d testt CREATE TABLE "schtest"."testt" ( "id" int NOT NULL DEFAULT next value for "schtest"."seq_4291", ...
The following page: http://monetdb.cwi.nl/projects/monetdb/SQL/Documentation/ Data-Types.html
Says this about the serial data type: "special 64 bit integer (sequence generator)"
and this about the 'int' data type: "32 bit integer"
This looks like it created a table with a 32-bit integer sequence rather than a 64-bit integer sequence.
If you use the auto_increment method you can set the type explicitly to be bigint, but should "serial" generate a bigint column also?
In fact "serial" is nothing more than a PostgreSQL convenience alias (like MySQL's auto_increment that MonetDB also supports), mapping onto the standard using sequences, hence that output when you describe the table again. I'd not be against making serial use a bigint, however, the best way to do it in MonetDB is to do it using a sequence. That said, our documentation still looks wrong to me, so thanks for the notice!