Bob Smith <bsmith@h-e.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