471,050 Members | 1,433 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,050 software developers and data experts.

plpgsql doesn't coerce boolean expressions to boolean


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....


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 11 '05 #1
0 1251

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Amin Schoeib | last post: by
6 posts views Thread by Martin Marques | last post: by
reply views Thread by Steve Wampler | last post: by
10 posts views Thread by lnd | last post: by
5 posts views Thread by Thomas Chille | last post: by
8 posts views Thread by Ivan Sergio Borgonovo | last post: by
1 post views Thread by Stefano Bonnin | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.