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 по дате отправления: