Re: Is this a bug???? - Mailing list pgsql-bugs

From Qingqing Zhou
Subject Re: Is this a bug????
Date
Msg-id dmvsvm$1v13$1@news.hub.org
Whole thread Raw
In response to Is this a bug????  (Joost Kraaijeveld <J.Kraaijeveld@Askesis.nl>)
List pgsql-bugs
"Joost Kraaijeveld" <J.Kraaijeveld@Askesis.nl> wrote
>
> select objectid,defaulttermsofpayment from prototype.customers
> where
> objectid = '336A0451-D9E8-7C11-6333-C17DF18E8979'
>
> I get the following answer:
>
> "336A0451-D9E8-7C11-6333-C17DF18E8979";"null"
>

test=# create table m (c1 char(10), c2 char(10));
CREATE TABLE
test=# insert into m values('hello', null);
INSERT 0 1
test=# select * from m where c1 = 'hello';
     c1     | c2
------------+----
 hello      |
(1 row)
test=# select * from m where c2 is null;
     c1     | c2
------------+----
 hello      |
(1 row)

Notice if an column is null, then nothing is shown. So the strange thing is
how you get "null"?

Regards,
Qingqing

pgsql-bugs by date:

Previous
From: Joost Kraaijeveld
Date:
Subject: Is this a bug????
Next
From: Tom Lane
Date:
Subject: Re: Is this a bug????