dbTalk Databases Forums  

[BUGS] CASE in where statement. BUG ??

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


Discuss [BUGS] CASE in where statement. BUG ?? in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Marek Lewczuk
 
Posts: n/a

Default [BUGS] CASE in where statement. BUG ?? - 12-19-2003 , 02:47 AM






I belive that I have found a bug - or maybe it was done on purpose. Have
a look at this query:


SELECT integer_field FROM bugtable WHERE (CASE WHEN '' <> '' THEN
integer_field = '' ELSE integer_field = 0 END);
Result: ERROR: invalid input syntax for integer: ""


SELECT text_field FROM bugtable WHERE (CASE WHEN '' <> '' THEN
text_field = '' ELSE text_field = '1' END);
Result: 1 rows fetched (0,02 sec)


Where table structure is:

CREATE TABLE "public"."bugtable" (
"integer_field" INTEGER,
"text_field" TEXT
) WITH OIDS;

I belive that PG reaction should be the same as in the second query --
there shouldn't be any errors.

$ psql --version
psql (PostgreSQL) 7.4
contains support for command-line editing
Windows XP/Cygwin


If this is not a bug, please tell me what is wrong.

ML



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

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.