From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jan Wieck <JanWieck@Yahoo.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: [SQL] plpgsql doesn't coerce boolean expressions to
Date: Tue, 30 Sep 2003 18:26:52 -0400
Message-ID: <23397.1064960812@sss.pgh.pa.us> (raw)
In-Reply-To: <9351.1064764963@sss.pgh.pa.us>
References: <15403.1063035632@sss.pgh.pa.us>
<3F5E0A5D.2010803@Yahoo.com>
<3559.1063128729@sss.pgh.pa.us>
<3F5E84CF.6090706@Yahoo.com>
<3487.1064712513@sss.pgh.pa.us>
<3F765672.2020304@Yahoo.com>
<9351.1064764963@sss.pgh.pa.us>
I said:
> If we want to preserve this behavior for IF et al, I don't think there
> is any practical way to apply SQL-level type coercion as I had wanted.
> We could instead make the code act like it's assigning to a plpgsql
> boolean variable --- but it will apply plpgsql's textual conversion
> methods, not SQL type coercion.
I have now written and tested the patch for this --- it's doing what I
originally called option 3:
>>> 3. Try to convert nonbooleans to boolean using plpgsql's usual method
>>> for cross-type coercion, ie run the type's output proc to get a
>>> string and feed it to bool's input proc. (This seems unlikely to
>>> avoid throwing an error in very many cases, but it'd be the most
>>> consistent with other parts of plpgsql.)
Unless someone objects, I'll commit this.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, JanWieck@Yahoo.com, pgsql-hackers@postgresql.org
Subject: Re: [SQL] plpgsql doesn't coerce boolean expressions to
In-Reply-To: <23397.1064960812@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox