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

Re: Probleme on ALTER

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Mickaël Jouanne <m(dot)jouanne(at)apr-job(dot)com>
Cc: pgsql-general(at)postgresql(dot)org, pgsql-novice(at)postgresql(dot)org
Subject: Re: Probleme on ALTER
Date: 2000-11-08 16:47:13
Message-ID: Pine.BSF.4.21.0011080841340.37590-100000@megazone23.bigpanda.com (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-novice
In 7.0, you have to go into pg_attribute and set
attnotnull manually and make sure that there already
isn't null data.  In 7.1, you can do the above or
you should be able to just add a table check constraint.

BTW: Was the alter you tried something you'd seen in 
another database or just a guess?  I've been wondering
about appropriate syntax for that since I haven't
seen one in sql92 (other than adding a table constraint
that checks the column against null).

Stephan Szabo
sszabo(at)bigpanda(dot)com

On Wed, 8 Nov 2000, [iso-8859-1] Mickal Jouanne wrote:

> Hello !
> 
> I have this table :
> 
>     Attribute    |     Type     |               Modifier                
> -----------------+--------------+---------------------------------------
>  ref             | integer      | default nextval('cvdb_ref_seq'::text)
>  nom             | varchar(50)  | 
>  prenom          | varchar(50)  | 
>  email           | varchar(100) | 
>  password        | varchar(20)  | 
> 
> 
> but i forgot to do "NOT NULL" on the fields.
> 
> I try ALTER table ALTER COLUMN ref ADD CONSTRAINT NOT NULL but it doesn't work.
> 
> Does someone have the right solution ?


In response to

pgsql-novice by date

Next:From: Stephan SzaboDate: 2000-11-08 16:48:25
Subject: Re: Probleme on ALTER
Previous:From: Mickaël JouanneDate: 2000-11-08 16:35:13
Subject: Probleme on ALTER

pgsql-general by date

Next:From: Stephan SzaboDate: 2000-11-08 16:48:25
Subject: Re: Probleme on ALTER
Previous:From: Mickaël JouanneDate: 2000-11-08 16:35:13
Subject: Probleme on ALTER

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