Re: [SQL] '' != NULL in PostGres???

Поиск
Список
Период
Сортировка
От Colin Dick
Тема Re: [SQL] '' != NULL in PostGres???
Дата
Msg-id Pine.LNX.3.96.980923115515.19576A-100000@ocis.ocis.net
обсуждение исходный текст
Ответ на Re: [SQL] '' != NULL in PostGres???  (Brook Milligan <brook@trillium.NMSU.Edu>)
Список pgsql-sql
>    nuacct=> create table users (
>    nuacct->  recno int,
>    nuacct->  custid int unique,
>    nuacct->  username char(14) not null,
>    nuacct->  service int
>    nuacct-> );
>
>    nuacct=> insert into users values
>    nuacct-> ( 0, 0, '', 0 );
>    INSERT 18241 1
>
>    ??? Shouldn't that have failed, generating an error ???
>
> No, but this will:
>
>    nuacct=> insert into users values ( 0, 0, null, 0 );
>
> '' is a zero length string not a null.

I wonder,
    Would

insert into users (recno, custid, service) values (0, 0, 0);

also fail?  As far as I can tell, if you don't expressly populate the
field, it will remain as a null....

--
Colin Dick
On Call Internet Services
cdick@mail.ocis.net




В списке pgsql-sql по дате отправления:

Предыдущее
От: David Hartwig
Дата:
Сообщение: Re: [SQL] case-insensitive SORT BY?
Следующее
От: lynch@lscorp.com (Richard Lynch)
Дата:
Сообщение: Re: [SQL] Cursors