Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f8A933743235 for ; Mon, 10 Sep 2001 05:03:03 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id f8A8tLi56594 for pgsql-admin@postgresql.org; Mon, 10 Sep 2001 04:55:22 -0400 (EDT) (envelope-from news) From: Arne Weiner X-Newsgroups: comp.databases.postgresql.admin Subject: Re: Changing column modifiers? Date: Mon, 10 Sep 2001 11:06:08 +0200 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 30 Message-ID: <3B9C8280.E36F9986@gmx.de> References: <1000084115.4120.2.camel@tim> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: scrappy@hub.org X-Mailer: Mozilla 4.5 [en] (X11; I; Linux 2.2.18 i586) X-Accept-Language: en To: pgsql-admin@postgresql.org X-Archive-Number: 200109/42 X-Sequence-Number: 2142 It seems that it is not possible to alter column constraints and table constraints do not include NOT NUL. But you can use CHECK as workaround: ALTER TABLE authors ADD CHECK (NOT authorfirstname = NULL); Arne. Tim Boring wrote: > > Can you change a column modifier after you've created the table? For > example, I have a table called "authors" with the following columns: > authorid, authorfirstname, authorlastname, authormi, statecode, country, > born, deceased. > > When I created the table, I forgot to make the "authorfirstname" and > "authorlastname" columns NOT NULL. I've looked at ALTER TABLE but I > don't see a way to use it to add NOT NULL...maybe I'm just missing the > obvious? > > Any help/suggestions are appreciated. > > Thanks, > Tim > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/users-lounge/docs/faq.html