Thread: restrict null in column??
Hi,
I'm trying to design a database and am trying to restrict the use of null values in the columns. When I create the column and check the box to restrict the null values, I can't save it. It gives me this error:
-2147467259: error while executing the query;
ERROR: adding not null columns is not implemented. Add the column, then use Alter Table Add Constraint.
In pgAdmin, you can view the column properties after you saved it, but can't change the null value state. Am I doing something wrong? do I have an old version or is this just another Postgres issue that I have to work around?
Thanks
James Newman
James Newman
Castleberry Investments
-----Original Message-----
From: James Newman [mailto:jamesn@cisonic.com]
Sent: 08 May 2002 20:55
To: pgadmin-support@postgresql.org
Subject: [pgadmin-support] restrict null in column??Hi,I'm trying to design a database and am trying to restrict the use of null values in the columns. When I create the column and check the box to restrict the null values, I can't save it. It gives me this error:-2147467259: error while executing the query;ERROR: adding not null columns is not implemented. Add the column, then use Alter Table Add Constraint.
Sorry, that's a bug in pgAdmin, it shouldn't let you even select it.
In pgAdmin, you can view the column properties after you saved it, but can't change the null value state. Am I doing something wrong? do I have an old version or is this just another Postgres issue that I have to work around?
This is just another PostgreSQL issue that I believe has been fixed for 7.3 (and which pgAdmin will support of course). In the meantime, (at completely your own risk, having take backups etc) you could alter the relevant attribute in the pg_class attribute and then restart the postmaster. Or dump to text file, modify the table definition and then reload.
Regards, Dave.