Bob Smith <bsmith(at)h-e(dot)com> writes:
> I need to change the not-null restriction on some columns in a table,
> and this doesn't seem to be possible with ALTER TABLE. Is it safe to
> connect as superuser and update pg_attribute.attnotnull directly?
Yeah. I am not certain offhand that currently-running backends would
notice such a change, but at worst starting new sessions would cause
them to honor it.
> I'm currently running 7.2.3, but will be upgrading soon so I'd like to
> know if this would work with 7.3 as well.
In 7.3 there are ALTER TABLE variants to handle this more cleanly.
regards, tom lane
In response to
pgsql-admin by date
|Next:||From: A.Bhuvaneswaran||Date: 2003-05-21 05:34:39|
|Subject: Logfile removal|
|Previous:||From: Bob Smith||Date: 2003-05-20 23:40:34|
|Subject: Changing NOT NULL condition on column|