ODBC-client->Linux-server: datatype boolean not recognized?
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
--------------------------------------------------------------
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_CHARSituation 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
numericPostgreSQL: 6.5.1
--------------------------------------------------------------
NEROC Publishing SolutionsJelle 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
--------------------------------------------------------------************
From bouncefilter Thu Sep 30 11:25:51 1999
Received: from oxmail.ox.ac.uk (oxmail1.ox.ac.uk [129.67.1.1])
by hub.org (8.9.3/8.9.3) with ESMTP id LAA49447
for <pgsql-general@postgresql.org>;
Thu, 30 Sep 1999 11:25:09 -0400 (EDT)
(envelope-from moray.mcconnachie@computing-services.oxford.ac.uk)
Received: from heraldgate2.oucs.ox.ac.uk
([163.1.2.50] helo=frontend2.herald.ox.ac.uk ident=exim)
by oxmail.ox.ac.uk with esmtp (Exim 2.10 #1)
id 11Wi4p-0003Di-00; Thu, 30 Sep 1999 16:24:59 +0100
Received: from moraypc.oucs.ox.ac.uk ([163.1.14.118] helo=moraypc)
by frontend2.herald.ox.ac.uk with smtp (Exim 2.02 #1)
id 11Wi4q-0000xt-00; Thu, 30 Sep 1999 16:25:00 +0100
Message-ID: <01d101bf0b57$f4aaae70$760e01a3@oucs.ox.ac.uk>
From: "Moray McConnachie" <moray.mcconnachie@computing-services.oxford.ac.uk>
To: "jose soares" <jose@sferacarta.com>
Cc: "postgresql-general" <pgsql-general@postgresql.org>
References: <199909301033.MAA06992@mail.neroc.nl>
<37F35BF3.862BC069@sferacarta.com>
Subject: Re: [GENERAL] ODBC-client->Linux-server: datatype boolean not
recognized?
Date: Thu, 30 Sep 1999 16:24:58 +0100
Organization: Oxford University
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
create function MsAccessBool(bool,int4) returns bool
as '' language 'internal';
There is surely something missing here, between the empty single
quotes? When I execute that, I get "There is no internal function
msaccessbool"