Pretty basic question. Is it necessary to add NOT NULL or UNIQUE NOT NULL to SERIAL or is this implicit and unnecessary?

ie.

CREATE TABLE new_table (
        id                             SERIAL UNIQUE NOT NULL,
        description             TEXT NOT NULL
);

Or should I just use below because Serial type implies this.

CREATE TABLE new_table (
        id                             SERIAL,
        description             TEXT NOT NULL
);


Regards,
David

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
     joining column's datatypes do not match

Reply via email to