Re: Inserts with incomplete rows... NOT NULL constraints

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Lars Erik Thorsplass <thorsplass(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Inserts with incomplete rows... NOT NULL constraints
Date: 2004-08-11 13:02:08
Message-ID: 200408111502.08030.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Am Mittwoch, 11. August 2004 14:35 schrieb Lars Erik Thorsplass:
> I would expect NULL fields not specified in the insert to get NULL
> inserted automatically. But that fields which are NOT NULL in the
> table structure gets inserted a NULL value too seems odd.

More accurately, the default value is inserted, which in turn is null if you
didn't specify one. You might find it odd that default values that are
inconsistent with constraints are allowed, but I don't see any reasonable
alternative.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Huxton 2004-08-11 13:34:15 Re: Inserts with incomplete rows... NOT NULL constraints
Previous Message Lars Erik Thorsplass 2004-08-11 12:35:32 Inserts with incomplete rows... NOT NULL constraints