Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 85AC747655C for ; Tue, 7 Jan 2003 08:27:38 -0500 (EST) Received: from serwer.skawsoft.com.pl (serwer.skawsoft.com.pl [213.25.37.66]) by postgresql.org (Postfix) with ESMTP id 7C4AC476342 for ; Tue, 7 Jan 2003 08:27:37 -0500 (EST) Received: from klaster.net (pi112.krakow.cvx.ppp.tpnet.pl [217.99.209.112]) by serwer.skawsoft.com.pl (Postfix) with ESMTP id 486762B21C; Tue, 7 Jan 2003 14:25:59 +0100 (CET) Message-ID: <3E1AD6AA.3080406@klaster.net> Date: Tue, 07 Jan 2003 14:31:22 +0100 From: Tomasz Myrta User-Agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.2b) Gecko/20021016 X-Accept-Language: en-us, en MIME-Version: 1.0 To: jack Cc: pgsql-sql@postgresql.org Subject: Re: A problem about alter table References: <001601c2b64b$ba8c3b30$1400a8c0@jac> In-Reply-To: <001601c2b64b$ba8c3b30$1400a8c0@jac> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/58 X-Sequence-Number: 10923 jack wrote: > Hi, all > I'm using postgreSQL 7.2.3. The following statement always cuases a parser > error, "parse error at or near NOT". Please adivse, thank you in advance. > > ALTER TABLE _acct_group1 > ALTER groupkey SET NOT NULL; > > Jack > From Postgres 7.2 documentation: "In the current implementation of ADD COLUMN, default and NOT NULL clauses for the new column are not supported. You can use the SET DEFAULT form of ALTER TABLE to set the default later. (You may also want to update the already existing rows to the new default value, using UPDATE.)" There is nothing about setting not null fields. I think you have to create trigger instead of altering table. Regards, Tomasz Myrta