Re: altering a table to set serial function

From: Pierre-Frédéric Caillaud <lists(at)boutiquenumerique(dot)com>
To: "Postgres General Milis" <pgsql-general(at)postgresql(dot)org>
Subject: Re: altering a table to set serial function
Date: 2004-07-28 11:12:26
Message-ID: opsbuhe0kpcq72hf@musicbox
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


> test=> alter table test add id int4 unique;
> NOTICE: ALTER TABLE / ADD UNIQUE will create implicit index
> "test_id_key" for table "test"
> ALTER TABLE

I'd add UNIQUE NOT NULL or PRIMARY KEY just in case some UPDATE tries to
modify the id field to NULL which would be a Very Bad Thing to do.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Pierre-Frédéric Caillaud 2004-07-28 11:19:06 Re: Sql injection attacks
Previous Message Pierre-Frédéric Caillaud 2004-07-28 11:09:17 Re: altering a table to set serial function