Received: from bologna.nettuno.it (bologna.nettuno.it [193.43.2.1]) by hub.org (8.9.3/8.9.3) with ESMTP id IAA24283; Thu, 30 Sep 1999 08:45:40 -0400 (EDT) (envelope-from jose@sferacarta.com) Received: from proxy.sferacarta.com (mail@sfcabop1.nettuno.it [193.207.10.213]) by bologna.nettuno.it (8.9.3/8.9.3/NETTuno 3.3) with ESMTP id OAA18264; Thu, 30 Sep 1999 14:45:25 +0200 (MDT) Received: from rosso.sferacarta.com (sferacarta.com) [10.20.30.5] by proxy.sferacarta.com with esmtp (Exim 2.05 #1 (Debian)) id 11WhNc-0005dP-00; Thu, 30 Sep 1999 14:40:20 +0000 Message-ID: <37F35BF3.862BC069@sferacarta.com> Date: Thu, 30 Sep 1999 14:47:47 +0200 From: jose soares X-Mailer: Mozilla 4.5 [it] (Win95; I) X-Accept-Language: it MIME-Version: 1.0 To: Jelle Ruttenberg CC: postgresql-interfaces , postgresql-general , postgresql-bugs Subject: Re: [GENERAL] ODBC-client->Linux-server: datatype boolean not recognized? References: <199909301033.MAA06992@mail.neroc.nl> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit I had the same problem using m$access as client because m$access treats the boolean value like an integer 0=false and -1=true while PostgreSQL treats the same value like a string ( 'true','t','1','y','yes','false','f','0','n','no'). I created the following function and operator and now it works. create function MsAccessBool(bool,int4) returns bool as '' language 'internal'; create operator = ( leftarg=bool, rightarg=int4, procedure=MsAccessBool, commutator='=', negator='<>', restrict=eqsel, join=eqjoinsel ); José PS: remember to uncheck the field: "Bools as char" in the ODBC manager. Jelle Ruttenberg ha scritto: > Hello all, > > I'm trying to connect from a ODBC-client to PostgreSQL on a Linux-server. > All is going well, except that the ODBC-client seems not to recognize the > PostgreSQL boolean-datatype. > > Is this really caused by PostgreSQL? If yes: is there a workaround, like > altering the datatypename in the proper places (pg_type?)? If no: then it > is another problem and can somebody give a hint? > > Thanks, > Jelle. > > I tested and encountered it in the following testsituations: > > Situation 1: > Client: Mac via OpenLink ODBC-Client > Server: Linux RH 6.0 via OpenLink Requestbroker > Result: it looks like PostgreSQL-boolean is converted to SQL_C_CHAR > > Situation 2: > Client: NT with psqlODBC > Server: same Linux > Result: in MS-Query: > - viewing the table-definitions, it comes with the message that it > doesn't recognize datatype 'bool' > - selecting values it looks like PostgreSQL-boolean is converted to a > numeric > > PostgreSQL: 6.5.1 > > -------------------------------------------------------------- > NEROC Publishing Solutions > > Jelle Ruttenberg > > De Run 1131, 5503 LB Veldhoven Phone : +31-(0)40-2586641 > P.O.Box 133, 5500 AC Veldhoven Fax : +31-(0)40-2541893 > The Netherlands E-mail : ruttenberg@neroc.nl > -------------------------------------------------------------- > > ************