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

Re: I think this is a BUG?

From: Alban Hertroys <dalroi(at)solfertje(dot)student(dot)utwente(dot)nl>
To: kaloyan(at)digsys(dot)bg
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: I think this is a BUG?
Date: 2008-04-24 18:31:49
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-generalpgsql-hackers
On Apr 24, 2008, at 10:11 AM, Kaloyan Iliev wrote:
> regbgrgr=# ALTER TABLE test ADD COLUMN not_null INT NOT NULL ;
> ERROR:  column "id" contains null values
> ==========================================EXAMPLE2==================== 
> ==================
> Example2:
> In this case the postgress fill the NOT NULL column ID from the  
> sequence.

What sequence? You never told it you wanted one. A PRIMARY KEY  
doesn't automatically add a sequence nor does a NOT NULL constraint,  
the serial type does that but you defined the column as type int, not  
as type serial.

Alban Hertroys

If you can't see the forest for the trees,
cut the trees and you'll see there is no forest.


In response to

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2008-04-24 18:36:01
Subject: Re: Proposed patch - psql wraps at window width
Previous:From: Bruce MomjianDate: 2008-04-24 18:25:58
Subject: Re: Proposed patch - psql wraps at window width

pgsql-general by date

Next:From: Tino WildenhainDate: 2008-04-24 19:01:14
Subject: Re: How to modify ENUM datatypes?
Previous:From: Chris BrowneDate: 2008-04-24 18:28:16
Subject: Re: Adding notes against fields

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