From: | Neil Harkins <nharkins(at)well(dot)com> |
---|---|
To: | pgsql-sql(at)postgreSQL(dot)org |
Subject: | '' != NULL in PostGres??? |
Date: | 1998-09-23 17:41:43 |
Message-ID: | Pine.GSO.3.96.980922180351.20111M-100000@well.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Hello. I am experimenting with Postgresql-6.3.2 on a RedHat 5.1 DEC Alpha:
nuacct=> create table users (
nuacct-> recno int,
nuacct-> custid int unique,
nuacct-> username char(14) not null,
nuacct-> service int
nuacct-> );
NOTICE: CREATE TABLE/UNIQUE will create implicit index users_custid_key
for table users
CREATE
nuacct=> insert into users values
nuacct-> ( 0, 0, '', 0 );
INSERT 18241 1
??? Shouldn't that have failed, generating an error ???
nuacct=> select * from users where username is null;
recno|custid|username|service
-----+------+--------+-------
(0 rows)
nuacct=> select * from users where username = '';
recno|custid| username|service
-----+------+--------------+-------
0| 0| | 0
(1 row)
nuacct=> \d users
Table = users
+----------------------------------+------------------------------+------+
| Field | Type |Length|
+----------------------------------+------------------------------+------+
| recno | int4 |4 |
| custid | int4 |4 |
| username | char() not null |14 |
| service | int4 |4 |
+----------------------------------+------------------------------+------+
???
From | Date | Subject | |
---|---|---|---|
Next Message | Brook Milligan | 1998-09-23 18:10:47 | Re: [SQL] '' != NULL in PostGres??? |
Previous Message | Glenn Sullivan | 1998-09-23 15:55:42 | Cursors |