Re: plpgsql doesn't coerce boolean expressions to boolean

From: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: plpgsql doesn't coerce boolean expressions to boolean
Date: 2003-09-08 16:20:56
Message-ID: 3F5CAC68.30502@pse-consulting.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql

Tom Lane wrote:

>Here are some possible responses, roughly in order of difficulty
>to implement:
>
>1. Leave well enough alone (and perhaps document the behavior).
>
>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...)

Regards,
Andreas

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Doug McNaught 2003-09-08 16:35:37 Re: plpgsql doesn't coerce boolean expressions to boolean
Previous Message Jenny - 2003-09-08 16:19:15 Re: row level lock and table level locks

Browse pgsql-sql by date

  From Date Subject
Next Message Doug McNaught 2003-09-08 16:35:37 Re: plpgsql doesn't coerce boolean expressions to boolean
Previous Message Andrew Dunstan 2003-09-08 16:10:27 Re: [HACKERS] plpgsql doesn't coerce boolean expressions to boolean