How to drop a NOT NULL column constraint?

From: Ed Loehr <eloehr(at)austin(dot)rr(dot)com>
To: pggeneral <pgsql-general(at)postgreSQL(dot)org>
Subject: How to drop a NOT NULL column constraint?
Date: 2001-01-02 17:54:55
Message-ID: 3A5215EF.E6174708@austin.rr.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have a table created like so:

CREATE TABLE foo (
id INTEGER NOT NULL
...
);

I need to alter the table to get rid of the "NOT NULL" constraint on the
'id' column. Can I do this using ALTER TABLE? Or do I have to
dump/recreate/reload the table?

I'm looking for something like "ALTER TABLE foo ALTER COLUMN id DROP NOT
NULL", but the docs don't hint at it...

Regards,
Ed Loehr

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Brett W. McCoy 2001-01-02 18:03:42 Re: How to drop a NOT NULL column constraint?
Previous Message Peter Eisentraut 2001-01-02 17:08:36 Re: System Tables Questions