From: Tom Lane <tgl@sss.pgh.pa.us>
To: Stephan Bauer <stephan_bauer@gmx.de>
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] NOT NULL and postgres 6.5.2
Date: Sun, 17 Oct 1999 11:58:00 -0400
Message-ID: <12783.940175880@sss.pgh.pa.us> (raw)
In-Reply-To: <3808BF7A.A83120D5@gmx.de>
Stephan Bauer <stephan_bauer@gmx.de> writes:
> CREATE TABLE anzeigen (
> ...
> name varchar(30) NOT NULL,
> ...
> );
> The following statement _will_ be inserted:
> INSERT INTO anzeigen ( ... name ...)
> VALUES ( ..., '', ...);
> What is my problem?
An empty string '' is quite different from a NULL.
If you want to forbid empty strings you could add a constraint
expression, eg, CHECK (name <> '').
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, stephan_bauer@gmx.de
Subject: Re: [SQL] NOT NULL and postgres 6.5.2
In-Reply-To: <12783.940175880@sss.pgh.pa.us>
References: <3808BF7A.A83120D5@gmx.de> <12783.940175880@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox