Re: plpgsql doesn't coerce boolean expressions to boolean

From: Doug McNaught <doug(at)mcnaught(dot)org>
To: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: plpgsql doesn't coerce boolean expressions to boolean
Date: 2003-09-08 16:35:37
Message-ID: m3d6eb1bmu.fsf@varsoon.wireboard.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql

Andreas Pflug <pgadmin(at)pse-consulting(dot)de> writes:

> Tom Lane wrote:
>
> >
> >2. Throw an error if the expression doesn't return boolean.
> >

> I'd opt for 2.
> It's quite common that newer compilers will detect more bogus coding
> than older ones. There might be existing functions that break from
> this because they rely on the current "feature", but there are
> probably others that will throw an exception, revealing bad coding
> (and delivering correct results just by chance, I've seen this more
> than once...)

I agree, and option 2 also makes sure that "bad" code will fail
cleanly, rather than possibly changing behavior and causing data
loss/corruption.

I agree with another poster that deprecation in 7.4 and removal in
7.5 might make sense.

-Doug

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-09-08 16:47:05 Re: plpgsql doesn't coerce boolean expressions to boolean
Previous Message Andreas Pflug 2003-09-08 16:20:56 Re: plpgsql doesn't coerce boolean expressions to boolean

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2003-09-08 16:47:05 Re: plpgsql doesn't coerce boolean expressions to boolean
Previous Message Andreas Pflug 2003-09-08 16:20:56 Re: plpgsql doesn't coerce boolean expressions to boolean