X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 9B5749DC810 for ; Sun, 22 Jan 2006 17:13:30 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 48587-10 for ; Sun, 22 Jan 2006 17:13:31 -0400 (AST) X-Greylist: delayed 00:59:34.383163 by SQLgrey- Received: from hosts.rhea.solnet (0x50c60afe.vgnxx3.adsl-dhcp.tele.dk [80.198.10.254]) by postgresql.org (Postfix) with ESMTP id EBC889DC870 for ; Sun, 22 Jan 2006 17:13:27 -0400 (AST) Received: from io.solnet (io.solnet [10.1.1.8]) (authenticated bits=0) by hosts.rhea.solnet (8.13.0/8.13.0) with ESMTP id k0MM0sAC005732 for ; Sun, 22 Jan 2006 23:00:54 +0100 Date: Sun, 22 Jan 2006 22:13:28 +0100 From: "Jesper K. Pedersen" To: pgsql-sql@postgresql.org Subject: Re: How to implement Microsoft Access boolean (YESNO) Message-ID: <20060122221328.433038a9@io.solnet> In-Reply-To: <22008.1137962771@sss.pgh.pa.us> References: <20060122211351.371f20d8@io.solnet> <22008.1137962771@sss.pgh.pa.us> X-Mailer: Sylpheed-Claws 1.9.100 (GTK+ 2.6.10; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamd / ClamAV version 0.74, clamav-milter version 0.74a on rhea X-Virus-Status: Clean X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.12 required=5 tests=[AWL=0.120] X-Spam-Score: 0.12 X-Spam-Level: X-Archive-Number: 200601/142 X-Sequence-Number: 23931 On Sun, 22 Jan 2006 15:46:11 -0500 Tom Lane wrote: > "Jesper K. Pedersen" writes: > > I am have some difficulties converting the Microsoft field of type > > YESNO (which is a simple boolean true/false) to something that is > > compatible with PostgreSQL. > > Assume that we have no idea what that is ;-). What is the I/O format > MSSQL uses for this datatype? Is YESNO actually the name of the type? > > If the problem is that Access is looking for that specific type name, > you could probably fake it out by creating a domain: > > create domain yesno as boolean; > create table foo (mycol yesno); > > This will only work if the I/O format is 't' and 'f', though. > Otherwise you'll need to make the domain be over a type with > suitable I/O format (perhaps integer or text will work). > Having checked the I/O format it seems that MS Access exports the values of a YESNO field as 0 and 1 I have tried the workaround with creating a domain for various datatypes but it wasnt passed through the odbc layer (have tried both with Linux/PostgreSQL and native Microsoft PostgreSQL 8.1 server both with the same result) :-\ Best regards Jesper K. Pedersen