Received: from bigglesworth.mail.be.easynet.net (bigglesworth.mail.be.easynet.net [212.100.160.67]) by postgresql.org (Postfix) with ESMTP id 639F5475A9E for ; Tue, 23 Jul 2002 09:50:36 -0400 (EDT) Received: from bidibule.office.be.easynet.net ([212.100.163.150]) by bigglesworth.mail.be.easynet.net with esmtp (Exim 3.35 #1) id 17X03k-0000mL-00 for pgsql-admin@postgresql.org; Tue, 23 Jul 2002 15:50:40 +0200 Received: from rb by bidibule.office.be.easynet.net with local (Exim 3.35 #1 (Debian)) id 17X01H-0005l3-00 for ; Tue, 23 Jul 2002 15:48:07 +0200 Date: Tue, 23 Jul 2002 15:48:07 +0200 From: Raphael Bauduin To: pgsql-admin@postgresql.org Subject: CREATE TABLE AS ... Message-ID: <20020723134807.GB22069@raphael> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Archive-Number: 200207/314 X-Sequence-Number: 4998 Hi, In a data model change, I wanted to use the "create table as select" feature. However, I want that table to have a primary key defined, and thus a field defined as NOT NULL. I didn't find a way to add a NOT NULL constraint on a column of an existing table. If there isn't, what's the best way to go? A COPY? Thanks. Raph