Re: [GENERAL] CASE in where statement. BUG ??

From: Csaba Nagy <nagy(at)ecircle-ag(dot)com>
To: Marek Lewczuk <newsy(at)lewczuk(dot)com>
Cc: Richard Huxton <dev(at)archonet(dot)com>, Alexander Litvinov <lan(at)ac-sw(dot)com>, Lista dyskusyjna pgsql-general <pgsql-general(at)postgresql(dot)org>, Lista dyskusyjna pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: [GENERAL] CASE in where statement. BUG ??
Date: 2003-12-19 10:22:35
Message-ID: 1071829354.1186.5.camel@coppola.ecircle.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-general

> Well, I must say that it is wird action... Why to check both elements of
> CASE expression, if we know for sure that only one will be executed ?

Because that's a syntax check, which does NOT evaluate any of the
expressions, only the types of them. Even if it will not be executed
ever, it is still wrong, and it should generate an error, because it
means a mistake on your side which potentially could leave to results
you didn't expect if executed as is.
If it would not generate error in these cases, you would scream when you
by mistake write a wrong query and it doesn't give you the right errors.
Say thanks to the parser that it catches your errors and doesn't let you
do detective work to find out why your queries are not working as you
expect them to work.

Cheers,
Csaba.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PostgreSQL Bugs List 2003-12-19 10:25:58 BUG #1016: incomplete src/bin/pgtclsh/Makefile
Previous Message Marek Lewczuk 2003-12-19 09:59:43 Re: [GENERAL] CASE in where statement. BUG ??

Browse pgsql-general by date

  From Date Subject
Next Message Marek Lewczuk 2003-12-19 10:38:41 Re: [GENERAL] CASE in where statement. BUG ??
Previous Message CoL 2003-12-19 10:17:44 Re: How to navigate tree without CONNECT BY?