Re: Modifying NOT NULL Constraint

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Dan Wilson" <phpPgAdmin(at)acucore(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Modifying NOT NULL Constraint
Date: 2000-06-14 04:33:15
Message-ID: 11373.960957195@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Dan Wilson" <phpPgAdmin(at)acucore(dot)com> writes:
> this was posed as a solutions to modifying the NOT NULL constraint:
>> update pg_attributes set attnotnull = 'f' where oid = oidofnotnullcolumn;
>> vacuum analyze;

attnotnull is where the gold is hidden, all right. The 'vacuum analyze'
step is mere mumbo-jumbo --- there's no need for that.

> Are there any side effects of which I should be aware before attempting to
> use this?

Changing in that direction should be safe enough. Turning attnotnull
*on* is a little more dubious, since it won't magically make any
existing null entries in the column go away. attnotnull just governs
the check that prevents you from storing new nulls.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2000-06-14 04:47:18 Re: Adding time to DATE type
Previous Message Tom Lane 2000-06-14 03:36:40 Re: Re: setproctitle