Re: How to ALTER COLUMN to set a constraint of not null?

From: Neil Conway <neilc(at)samurai(dot)com>
To: Peter Gibbs <peter(at)emkel(dot)co(dot)za>
Cc: Jean-Christian Imbeault <jc(at)mega-bucks(dot)co(dot)jp>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to ALTER COLUMN to set a constraint of not null?
Date: 2003-01-15 20:19:36
Message-ID: 1042661976.20007.6.camel@tokyo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 2003-01-14 at 04:47, Peter Gibbs wrote:
> Jean-Christian Imbeault wrote:
> > How does one add a "NOT NULL" constraint to a new column?

> ALTER TABLE [ ONLY ] table [ * ]
> ALTER [ COLUMN ] column { SET | DROP } NOT NULL

Note that using ALTER TABLE to make a column NOT NULL is fully supported
as of PostgreSQL 7.3 -- since the idocs are still from 7.2, they are
correct when they say there's no way to do it (using ALTER TABLE).

Cheers,

Neil
--
Neil Conway <neilc(at)samurai(dot)com> || PGP Key ID: DB3C29FC

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-01-15 20:26:48 Re: CREATE TYPE example needed
Previous Message Neil Conway 2003-01-15 20:16:00 Re: gmake check error on HPUX