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

Re: Changing from NOT NULL to NULL

From: Nabil Sayegh <postgresql(at)e-trolley(dot)de>
To: Rob Mosher <mosher(at)andrews(dot)edu>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Changing from NOT NULL to NULL
Date: 2004-02-15 23:20:54
Message-ID: 402FFED6.40808@e-trolley.de (view raw or flat)
Thread:
Lists: pgsql-novice
Rob Mosher wrote:
> Is there anyway I can change a field to allowing nulls without dumping 
> the table, dropping it, recreating it as desired, and filling all the 
> data back in?

ALTER TABLE tab ALTER COLUMN col DROP NOT NULL;

HTH
-- 
  e-Trolley Sayegh & John, Nabil Sayegh
  Tel.: 0700 etrolley /// 0700 38765539
  Fax.: +49 69 8299381-8
  PGP : http://www.e-trolley.de

In response to

pgsql-novice by date

Next:From: Michael GlaesemannDate: 2004-02-15 23:33:20
Subject: Re: Changing from NOT NULL to NULL
Previous:From: Tom LaneDate: 2004-02-15 23:08:27
Subject: Re: Changing from NOT NULL to NULL

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