X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 81632D1BA14 for ; Wed, 20 Aug 2003 12:46:00 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 93595-09 for ; Wed, 20 Aug 2003 12:45:47 -0300 (ADT) Received: from megazone.bigpanda.com (45.mufb.snfc.sffca01r18.dsl.att.net [12.103.249.45]) by svr1.postgresql.org (Postfix) with ESMTP id 09BD7D1B9FB for ; Wed, 20 Aug 2003 12:45:47 -0300 (ADT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 922B1D680; Wed, 20 Aug 2003 08:45:46 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 6F9025C0E; Wed, 20 Aug 2003 08:45:46 -0700 (PDT) Date: Wed, 20 Aug 2003 08:45:46 -0700 (PDT) From: Stephan Szabo To: Rhaoni Chiu Pereira Cc: Lista PostgreSQL Subject: Re: Explicit Cast In-Reply-To: <1061382268.3f43687cc3565@sistemica.info> Message-ID: <20030820084251.T7072-100000@megazone.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/224 X-Sequence-Number: 9945 On Wed, 20 Aug 2003, Rhaoni Chiu Pereira wrote: > Hi List, > > As I already said .. I'm porting an Oracle DB to PostgreSQL and I must > rewrite most of the functions . So I have a problem to do something like this: > > ... atual_fatura in(''+'',''-'') ... > > It gives me the following error: > > Unable to identify an operator '-' for types 'numeric' and 'character varying' > You will have to retype this query using an explicit castenciosamente, > > atual_fatura is a varchar field. > > I read howto create an explicit cast but I didn't understand what I must do in > this case. Can you send the actual function you're having problems with and version information? I don't seem to get an error with a simple function that uses such a construct on 7.3.4, but I expect the real example is more complicated.