Skip site navigation (1) Skip section navigation (2)

Adding Serial Type

From: David Pratt <fairwinds(at)eastlink(dot)ca>
To: pgsql-admin(at)postgresql(dot)org
Subject: Adding Serial Type
Date: 2005-05-28 17:27:17
Message-ID: BD5CCB8C-CF9D-11D9-AEE7-000A27B3B070@eastlink.ca (view raw or flat)
Thread:
Lists: pgsql-admin
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

In response to

Responses

pgsql-admin by date

Next:From: Bruno Wolff IIIDate: 2005-05-28 18:27:54
Subject: Re: Adding Serial Type
Previous:From: vamsi krishnaDate: 2005-05-28 13:07:34
Subject: Create relation

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group