Skip site navigation (1) Skip section navigation (2)

Re: NOT NULL

From: elein <elein(at)varlena(dot)com>
To: David Wheeler <david(at)kineticode(dot)com>
Cc: sfpug(at)postgresql(dot)org
Subject: Re: NOT NULL
Date: 2003-10-30 01:27:58
Message-ID: 20031029172758.J28004@cookie.varlena.com (view raw or flat)
Thread:
Lists: sfpug
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?

--elein

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'
>           )
> 
> TIA,
> 
> David
> 
> -- 
> 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

Responses

sfpug by date

Next:From: David WheelerDate: 2003-10-30 01:33:01
Subject: Re: NOT NULL
Previous:From: David WheelerDate: 2003-10-30 01:20:52
Subject: NOT NULL

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group