Home > Archive > PostgreSQL Bugs > December 2005 > Is this a bug????









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Is this a bug????
Joost Kraaijeveld

2005-12-04, 8:24 pm

If I run this query:

select objectid,defaultterm
sofpayment from prototype.customers
where
objectid = '336A0451-D9E8-7C11-6333-C17DF18E8979'

I get the following answer:

"336A0451-D9E8-7C11-6333-C17DF18E8979";"null"

If I run this query I get *no* results:

select objectid,defaultterm
sofpayment from prototype.customers
where
defaulttermsofpaymen
t is null

Is this a bug?


--
Groeten,

Joost Kraaijeveld
Askesis B.V.
Molukkenstraat 14
6524NB Nijmegen
tel: 024-3888063 / 06-51855277
fax: 024-3608416
e-mail: J.Kraaijeveld@Askesis.nl
web: www.askesis.nl



---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Qingqing Zhou

2005-12-04, 8:24 pm


"Joost Kraaijeveld" <J.Kraaijeveld@Askesis.nl> wrote

>
> select objectid,defaultterm
sofpayment 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


Tom Lane

2005-12-04, 8:24 pm

Joost Kraaijeveld <J.Kraaijeveld@Askesis.nl> writes:
> If I run this query:
> select objectid,defaultterm
sofpayment from prototype.customers
> where
> objectid = '336A0451-D9E8-7C11-6333-C17DF18E8979'


> I get the following answer:


> "336A0451-D9E8-7C11-6333-C17DF18E8979";"null"


> If I run this query I get *no* results:


> select objectid,defaultterm
sofpayment from prototype.customers
> where
> defaulttermsofpaymen
t is null


> Is this a bug?


Not unless you can prove that the defaulttermsofpaymen
t field is
actually null, and not the string "null" as it appears to be.

(What client-side software are you using? psql wouldn't display
the row like that, nor anything else I'm familiar with.)

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com