Well, you'll run into problems if there are
any nulls hanging around int the column.
What is the problem with alter table? Or
are you not at that version?
On Wed, Oct 29, 2003 at 05:20:52PM -0800, David Wheeler wrote:
> Hi All,
> Quick question. Is there anything wrong with using this approach to
> turning an existing column into a NOT NULL column?
> UPDATE pg_attribute
> SET attnotnull = 't'
> WHERE attname = 'primary_oc__id'
> AND attrelid in (
> SELECT pg_class.oid
> FROM pg_class
> WHERE relkind='r'
> AND relname='element__site'
> David Wheeler AIM: dwTheory
> david(at)kineticode(dot)com ICQ: 15726394
> http://www.kineticode.com/ Yahoo!: dew7e
> Jabber: Theory(at)jabber(dot)org
> Kineticode. Setting knowledge in motion.[sm]
In response to
- NOT NULL at 2003-10-30 01:20:52 from David Wheeler
sfpug by date
|Next:||From: David Wheeler||Date: 2003-10-30 01:33:01|
|Subject: Re: NOT NULL|
|Previous:||From: David Wheeler||Date: 2003-10-30 01:20:52|
|Subject: NOT NULL|