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

Message about not null in ALTER TABLE

From: Alvaro Herrera <alvherre(at)atentus(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Message about not null in ALTER TABLE
Date: 2002-01-21 06:44:55
Message-ID: 1011595495.18821.18.camel@cm-lcon1-40-151.chello.cl (view raw or flat)
Thread:
Lists: pgsql-bugs
I think this is a bug in the error message:

alvherre=> alter table test add column b int not null;
ERROR:  Adding NOT NULL columns is not implemented.
	Add the column, then use ALTER TABLE ADD CONSTRAINT.

However, there is no way to add a NOT NULL constraint to an existing
column in a table, so the error message is misleading.

alvherre=> alter table test add constraint bnotnull not null b;
ERROR:  parser: parse error at or near "not"

-- 
Alvaro Herrera (<alvherre[a]atentus.com>)
"Siempre hay que alimentar a los dioses, aunque la tierra este seca"
(Orual)


Responses

pgsql-bugs by date

Next:From: Hans PlumDate: 2002-01-21 23:26:51
Subject: Bug: Importing files of different sizes via psql -f
Previous:From: pgsql-bugsDate: 2002-01-21 04:49:45
Subject: Bug #564: CREATE TABLE with long table name and long serial column name can cause conflicting sequence naming

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