Re: Not null contraints

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Tamsin" <tg_mail(at)bryncadfan(dot)co(dot)uk>
Cc: "Postgres General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Not null contraints
Date: 2000-10-14 04:26:32
Message-ID: 1668.971497592@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Tamsin" <tg_mail(at)bryncadfan(dot)co(dot)uk> writes:
> I want to remove a not null constraint from a table. I've read the posts
> about having to rename, recreate without not nulls & insert back into the
> table. This is fine, but the table also has a lot of foreign keys/rules etc
> & recreating all these is a bit of pain.
> I tried updating pg_attribute & setting attnotnull to 'f' for the field in
> question. This seems to have worked. Is it safe?! - is there anything else
> I should be aware of?

Yup, that should do the trick. Not much magic here...

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message The Hermit Hacker 2000-10-14 04:38:19 RE: Matlab Mex Interface
Previous Message Philip Warner 2000-10-14 04:25:10 Re: Question about pg_dump