pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Neil Harkins <nharkins@well.com>
To: pgsql-sql@postgreSQL.org
Subject: '' != NULL in PostGres???
Date: Wed, 23 Sep 1998 10:41:43 -0700 (PDT)
Message-ID: <Pine.GSO.3.96.980922180351.20111M-100000@well.com> (raw)


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     |
+----------------------------------+------------------------------+------+

???




view thread (4+ messages)  latest in thread

Message-ID: <Pine.GSO.3.96.980922180351.20111M-100000@well.com>
Permalink:  ../Pine.GSO.3.96.980922180351.20111M-100000@well.com/
Also on:    postgresql.org/message-id/Pine.GSO.3.96.980922180351.20111M-100000@well.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: nharkins@well.com
  Subject: Re: '' != NULL in PostGres???
  In-Reply-To: <Pine.GSO.3.96.980922180351.20111M-100000@well.com>
  References: <Pine.GSO.3.96.980922180351.20111M-100000@well.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox