NOT NULL Issue

Поиск
Список
Период
Сортировка
От Gustav Lindenberg
Тема NOT NULL Issue
Дата
Msg-id 2238dbef0709101136l13d91fb8uabee6dab3869c2fc@mail.gmail.com
обсуждение исходный текст
Ответы Re: NOT NULL Issue  (Gregory Stark <stark@enterprisedb.com>)
Re: NOT NULL Issue  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Max
Дата:
Сообщение: Re: arrays of foreign keys
Следующее
От: finecur
Дата:
Сообщение: constrains on two tables