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

Re: Editing problem for bool fields with not null

From: Dave Page <dpage(at)postgresql(dot)org>
To: Vladimir Kokovic <vladimir(dot)kokovic(at)a-asoft(dot)com>
Cc: pgadmin-support(at)postgresql(dot)org
Subject: Re: Editing problem for bool fields with not null
Date: 2007-09-17 13:30:03
Message-ID: 46EE815B.5080101@postgresql.org (view raw or flat)
Thread:
Lists: pgadmin-support
Vladimir Kokovic wrote:
> Hi,
> 
> I've tried to edit BOOL NOT NULL field which have value TRUE within
> 'Edit Data' window,
> but error dialog appeared with text
> "ERROR: null value in column "vazeci" violates not-null constraint"
> even field has DEFAULT TRUE clause !

The boolean editor in the grid uses a tri-state control which can select
TRUE, FALSE and NULL. If you set it to NULL as it sounds you have, it
will attempt to explicitly update the value to NULL which Postgres will
reject in your case because of the NOT NULL clause.

Note that Postgres will only use the default value for an INSERT which
doesn't specify a value for the column, or for an INSERT or UPDATE when
the column value is specified as the keyword DEFAULT (which is not
possible in the Edit Grid).

Regards, Dave.

In response to

pgadmin-support by date

Next:From: Erwin BrandstetterDate: 2007-09-17 14:44:40
Subject: Re: Problems with "NOTICE"-messages
Previous:From: Vladimir KokovicDate: 2007-09-17 13:16:35
Subject: Editing problem for bool fields with not null

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