plpgsql doesn't coerce boolean expressions to boolean - Mailing list pgsql-general

From Frank van Vugt
Subject plpgsql doesn't coerce boolean expressions to boolean
Date
Msg-id 200309101524.59312.ftm.van.vugt@foxi.nl
Whole thread Raw
List pgsql-general
Hi,

FWIW, I walked into this one when changing an int[ ] into a numeric(5,1)[ ] :


IF ( 0::int ) => interpreted as false

IF ( 0.0::numeric(5,1) ) => interpreted as true


Yes, there should have been used some expression that evaluated to a boolean
to begin with, but 'if (int)' is not all that uncommon ;-)

However, I expected the numeric to be coerced to integer, so the result in
itself did surprise me....





--
Best,




Frank.


pgsql-general by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: Constructing column from different individual fields in same row.
Next
From: "Jules Alberts"
Date:
Subject: help with TCL function