X-Original-To: pgsql-sql@postgresql.org Received: from matrix.gatewaynet.com (unknown [217.19.69.50]) by postgresql.org (Postfix) with ESMTP id C451A474E44 for ; Fri, 21 Mar 2003 08:42:56 -0500 (EST) Received: from matrix.gatewaynet.com (matrix.gatewaynet.com [217.19.69.50] (may be forged)) by matrix.gatewaynet.com (8.12.5/8.12.5) with ESMTP id h2LHsuIs002807; Fri, 21 Mar 2003 15:54:56 -0200 Received: from localhost (achill@localhost) by matrix.gatewaynet.com (8.12.5/8.12.5/Submit) with ESMTP id h2LHsuGH002803; Fri, 21 Mar 2003 15:54:56 -0200 Date: Fri, 21 Mar 2003 15:54:56 -0200 (GMT+2) From: Achilleus Mantzios To: Eric Veldhuyzen Cc: pgsql-sql@postgresql.org Subject: Re: cast of integer to bool doesn't work (anymore?) In-Reply-To: <20030321133646.GC6540@opium.xs4all.nl> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200303/497 X-Sequence-Number: 12536 On Fri, 21 Mar 2003, Eric Veldhuyzen wrote: > Hi, > > Here at my work we use on the production servers PostgreSQL version > 7.2.3, but I have version 7.3.2 (from the Debian distribution) on my > workstation. Now I noticed yesterday that the query 'select 0::boolean;' > works on the production server, it gives the output: > > # select 0::boolean; > bool > ------ > f > (1 row) > > Perfect. But when I try this on my local version of postgreSQL I get > this: > > # select 0::boolean; > ERROR: Cannot cast type integer to boolean Just wrap 0 with single quotes, e.g. # select '0'::boolean; > > Is there someone who can axplaint to me why this is happening, did I > forget to do something to make this work, or is this some kind of new > 'feature' of the 7.3 version? > > -- ================================================================== Achilleus Mantzios S/W Engineer IT dept Dynacom Tankers Mngmt Nikis 4, Glyfada Athens 16610 Greece tel: +30-210-8981112 fax: +30-210-8981877 email: achill@matrix.gatewaynet.com mantzios@softlab.ece.ntua.gr