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

NOT NULL

From: David Wheeler <david(at)kineticode(dot)com>
To: sfpug(at)postgresql(dot)org
Subject: NOT NULL
Date: 2003-10-30 01:20:52
Message-ID: 4D7F8F59-0A77-11D8-B4BC-0003931A964A@kineticode.com (view raw or flat)
Thread:
Lists: sfpug
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]


Responses

sfpug by date

Next:From: eleinDate: 2003-10-30 01:27:58
Subject: Re: NOT NULL
Previous:From: Sudhakar AvulaDate: 2003-10-29 23:13:27
Subject: AIX

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