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 B039AD1D065 for ; Thu, 15 Apr 2004 08:41:56 -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 87253-04 for ; Thu, 15 Apr 2004 08:41:58 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id 45B86D1D06D for ; Thu, 15 Apr 2004 08:41:55 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id i3FBfsSx092216 for ; Thu, 15 Apr 2004 11:41:54 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id i3FBUEKP089035 for pgsql-sql@postgresql.org; Thu, 15 Apr 2004 11:30:14 GMT From: CoL X-Newsgroups: comp.databases.postgresql.sql Subject: Re: problem porting MySQL SQL to Postgres Date: Thu, 15 Apr 2004 13:30:12 +0200 Organization: Hub.Org Networking Services Lines: 36 Message-ID: References: <4A063822-8EC7-11D8-9677-000A958E367A@llgc.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@news.hub.org User-Agent: Mozilla Thunderbird 0.5+ (Windows/20040223) X-Accept-Language: en-us, en In-Reply-To: <4A063822-8EC7-11D8-9677-000A958E367A@llgc.org.uk> To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200404/176 X-Sequence-Number: 17551 hi, 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 > (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. use OR not ||. C.