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 7B8C09DCB80 for ; Sun, 22 Jan 2006 16:46:12 -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 47753-05 for ; Sun, 22 Jan 2006 16:46:13 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 0C05C9DCB4D for ; Sun, 22 Jan 2006 16:46:09 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id k0MKkB2W022009; Sun, 22 Jan 2006 15:46:11 -0500 (EST) To: "Jesper K. Pedersen" cc: pgsql-sql@postgresql.org Subject: Re: How to implement Microsoft Access boolean (YESNO) fieldtype in PostgreSQL ? In-reply-to: <20060122211351.371f20d8@io.solnet> References: <20060122211351.371f20d8@io.solnet> Comments: In-reply-to "Jesper K. Pedersen" message dated "Sun, 22 Jan 2006 21:13:51 +0100" Date: Sun, 22 Jan 2006 15:46:11 -0500 Message-ID: <22008.1137962771@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.096 required=5 tests=[AWL=0.096] X-Spam-Score: 0.096 X-Spam-Level: X-Archive-Number: 200601/141 X-Sequence-Number: 23930 "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). regards, tom lane