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: (view raw, whole thread or download thread mbox)
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?


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


In response to


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-2017 The PostgreSQL Global Development Group