dbTalk Databases Forums  

[BUGS] Is this a bug????

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] Is this a bug???? in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Joost Kraaijeveld
 
Posts: n/a

Default [BUGS] Is this a bug???? - 12-04-2005 , 05:02 PM






If I run this query:

select objectid,defaulttermsofpayment 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,defaulttermsofpayment from prototype.customers
where
defaulttermsofpayment 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 (AT) Askesis (DOT) nl
web: www.askesis.nl



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

Reply With Quote
  #2  
Old   
Qingqing Zhou
 
Posts: n/a

Default Re: [BUGS] Is this a bug???? - 12-04-2005 , 05:10 PM







"Joost Kraaijeveld" <J.Kraaijeveld (AT) Askesis (DOT) nl> wrote
Quote:
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



---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend


Reply With Quote
  #3  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] Is this a bug???? - 12-04-2005 , 06:24 PM



Joost Kraaijeveld <J.Kraaijeveld (AT) Askesis (DOT) nl> writes:
Quote:
If I run this query:
select objectid,defaulttermsofpayment 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,defaulttermsofpayment from prototype.customers
where
defaulttermsofpayment is null

Is this a bug?
Not unless you can prove that the defaulttermsofpayment 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


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.