X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 42417D1DB98 for ; Thu, 15 Apr 2004 07:57:45 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 70703-04 for ; Thu, 15 Apr 2004 07:57:46 -0300 (ADT) Received: from spoetnik.xs4all.nl (spoetnik.xs4all.nl [213.84.24.58]) by svr1.postgresql.org (Postfix) with ESMTP id 0EA20D1DB99 for ; Thu, 15 Apr 2004 07:57:43 -0300 (ADT) Received: by spoetnik.xs4all.nl (Postfix, from userid 1000) id 28F831CC22; Thu, 15 Apr 2004 11:55:56 +0200 (CEST) Date: Thu, 15 Apr 2004 11:55:56 +0200 From: Reinoud van Leeuwen To: pgsql-sql@postgresql.org Subject: Re: problem porting MySQL SQL to Postgres Message-ID: <20040415095556.GA709@spoetnik.xs4all.nl> Mail-Followup-To: pgsql-sql@postgresql.org References: <4A063822-8EC7-11D8-9677-000A958E367A@llgc.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A063822-8EC7-11D8-9677-000A958E367A@llgc.org.uk> User-Agent: Mutt/1.4.2.1i X-message-flag: Warning! The sender of this mail thinks you should use a more secure email client. X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200404/135 X-Sequence-Number: 17510 On Thu, Apr 15, 2004 at 11:25:59AM +0100, Dan Field wrote: > I've stumbled across a query I don't quite understand the error message > for. > > This query is pulled from a working MySQL setup: > > SELECT > DEWEY_ID, DEWEY_HUNDREDS, DEWEY_TENS, DEWEY_ONES, DEWEY_POINT_ONES, > DEWEY_POINT_TENS, > DEWEY_POINT_HUNDREDS, DEWEY_POINT_THOUSANDS, DEWEY_TYPE, > DEWEY_LANG, DEWEY_SUBJECT FROM lu_dewey > WHERE > (DEWEY_HUNDREDS = 9) AND > (DEWEY_TENS >= 0) AND > (DEWEY_TENS <= 9) AND > (DEWEY_ONES = 0 || DEWEY_ONES = NULL) AND > (DEWEY_POINT_ONES = 0 || DEWEY_POINT_ONES = NULL) AND > (DEWEY_POINT_TENS = 0 || DEWEY_POINT_TENS = NULL) AND > (DEWEY_POINT_HUNDREDS = 0 || DEWEY_POINT_HUNDREDS = NULL) AND > (DEWEY_POINT_THOUSANDS = 0 || DEWEY_POINT_THOUSANDS = NULL) AND please use 'IS NULL' instead of '= NULL' > (DEWEY_TYPE = 't') AND > (DEWEY_LANG = 'en') > ORDER BY DEWEY_TENS > > > However I'm getting the following error: > > ERROR: Unable to identify an operator '=' for types 'character' and > 'boolean' You will have to retype this query using an explicit cast. can you post the output of '\d lu_dewey'? -- __________________________________________________ "Nothing is as subjective as reality" Reinoud van Leeuwen reinoud.v@n.leeuwen.net http://www.xs4all.nl/~reinoud __________________________________________________