NOT NULL Issue - Mailing list pgsql-general

From Gustav Lindenberg
Subject NOT NULL Issue
Date
Msg-id 2238dbef0709101136l13d91fb8uabee6dab3869c2fc@mail.gmail.com
Whole thread Raw
Responses Re: NOT NULL Issue  (Gregory Stark <stark@enterprisedb.com>)
Re: NOT NULL Issue  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Hi

Why is ''  not considered null is postgres (8.1.3) Currently I have to
use the following workaround where I have zero length strings in char
fields.

select * from  security.users  where length(us_username)=0;
Surely this a null. Apparently not in Postgres.

Currently I have to use the following SQL to pick up zero length strings:
alter table security.users add constraint notnull_username
check(us_username <> '');

Thanks
Gustav

pgsql-general by date:

Previous
From: Max
Date:
Subject: Re: arrays of foreign keys
Next
From: finecur
Date:
Subject: constrains on two tables