473,405 Members | 2,154 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

plpgsql doesn't coerce boolean expressions to boolean

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

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Amin Schoeib | last post by:
Hi, How can I make textoutput (for example for tracing the code) in PLPGSQL. In Oracle you can do that using dbms.output.put_line Thanxx Schoeib 4Tek Gesellschaft für angewandte...
0
by: Frank van Vugt | last post by:
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
6
by: Martin Marques | last post by:
We are trying to make some things work with plpgsql. The problem is that I built several functions that call one another, and I thought that the way of calling it was just making the assign: ...
3
by: Max Speransky | last post by:
Hello My task is to validate expression and get value of it in boolean variable. I try to do following: CREATE OR REPLACE FUNCTION get_value(integer) RETURNS boolean AS' DECLARE Ret ...
0
by: Steve Wampler | last post by:
Hmmm, I've always used plpgsql.so (also formerly known as libplpgsql.so, I think...) as in: CREATE FUNCTION plpgsql_call_handler () RETURNS language_handler AS '/usr/lib/plpgsql.so',...
10
by: lnd | last post by:
After copied pg database from one PC to another -I could not find plpgsql function(s) in the copied database. -had to instal plpgsql language handler again -whilst tables and data moved...
5
by: Thomas Chille | last post by:
Hi, i am playing around with PLpgSQL and can not solve one problem: I am fetching some rows of a special rowtype and wanna give this rows step by step to a function with this rowtype as...
8
by: Ivan Sergio Borgonovo | last post by:
what's wrong with this? create type tSession as ( ty_found boolean, ty_Session char(32) ); create or replace function GetSessionID( integer ) returns tSession as ' declare thisSession...
1
by: Stefano Bonnin | last post by:
CORRECTION, even if I define a stupid "hello world" trigger function the problem is present: for example CREATE FUNCTION sns_action () RETURNS TRIGGER AS ' BEGIN RAISE NOTICE ''hello...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.