Re: null constraints and defaults

From: Matt Miller <mattm(at)epx(dot)com>
To: elein <elein(at)varlena(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: null constraints and defaults
Date: 2005-06-29 20:25:09
Message-ID: 1120076709.3095.25.camel@dbamm01-linux
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 2005-06-29 at 13:04 -0700, elein wrote:
> default constraint
> ...
> elein=# insert into nulldefault values (NULL);
> ERROR: null value in column "one" violates not-null constraint

I think the idea of a DEFAULT value is to tell the DB what to supply
only if you omit the column from the insert statement altogether. If
you deliberately call for a NULL, the DB will try to oblige.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Charles Swiger 2005-06-29 20:40:52 Re: PostgreSQL's vacuumdb fails to allocate memory for non-root users
Previous Message Sven Willenberger 2005-06-29 20:12:26 Re: PostgreSQL's vacuumdb fails to allocate memory for