473,666 Members | 2,604 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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*******@postg resql.org so that your
message can get through to the mailing list cleanly

Nov 11 '05 #1
0 1341

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

Similar topics

3
12232
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 Informationstechnologien mbH Schoeib Amin
0
411
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
3967
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: var:=func1(arg1,arg2); which gave me an error near ")". Now if I did the same, but like this:
3
4389
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 boolean; Op TEXT = ''=''; BEGIN
0
2680
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', 'plpgsql_call_handler' LANGUAGE c; CREATE TRUSTED PROCEDURAL LANGUAGE plpgsql HANDLER plpgsql_call_handler;
10
2929
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 fine The copy included all under /cygwin/usr/local/pgsql/data and database was down while making a copy.
5
1603
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 parameter. evertime i get the errormessage: ERROR: Attribut »_row« not found but the Attribut exists and has values in his fields. i have absolutly no idea was happens there. can someone help me please? thanx
8
2273
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 tSession; begin
1
1241
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 world!''; RETURN NEW;
0
8454
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8362
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8878
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8644
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7389
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5671
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2776
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1778
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.