Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id EE4AE632BBB for ; Thu, 5 Aug 2010 18:45:17 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 86277-08 for ; Thu, 5 Aug 2010 21:45:07 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mail.postgresql.org (Postfix) with ESMTP id 57278632234 for ; Thu, 5 Aug 2010 18:45:06 -0300 (ADT) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Oh8FL-0007MW-KY for pgsql-sql@postgresql.org; Thu, 05 Aug 2010 23:45:03 +0200 Received: from ool-457c7a45.dyn.optonline.net ([69.124.122.69]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 05 Aug 2010 23:45:03 +0200 Received: from db3l.net by ool-457c7a45.dyn.optonline.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 05 Aug 2010 23:45:03 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-sql@postgresql.org From: David Bolen Subject: Re: Domains, casts, and MS Access Date: Thu, 05 Aug 2010 17:28:13 -0400 Lines: 45 Message-ID: References: <4C59CC8C.1010206@magwerks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: ool-457c7a45.dyn.optonline.net User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (darwin) Cancel-Lock: sha1:L3Dp0vTX20StMJjij0A+/Bc3GeE= X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201008/31 X-Sequence-Number: 34471 Peter Koczan writes: > On Wed, Aug 4, 2010 at 4:40 PM, Richard Broersma > wrote: (...) >> I know that there is a setting in the ODBC driver for true = -1 but it >> doesn't work well.  I also remember that filters didn't work on mapped >> boolean columns. > > Yep, that's the stumbling block we're running into. ODBC and these > fields' assumptions of true/false are at odds. I'm trying a few other > things with casts in the meantime to see if they'll work. I'm still supporting a legacy Access front-end that I converted over to PostgreSQL a few years back, and did have to do some work for boolean fields. It's been a while, but I believe I: * Disabled the ODBC driver option "Bools as Char" * Did not enable the "True=-1" option in the driver * Ensured that no boolean fields were nullable (otherwise in a query that Access uses to determine if a record changed prior to posting its own changes the NULL value would become False by the time it reached Access, and Access would then fail to post changes believing the row had already been edited). * Added a series of functions for integer/boolean comparisons, so filters and queries would work. Outside of boolean support, I also needed to add a "lo" domain to work with some fields across the interface (I think text fields that were memo on the Access side, but it's been a while). I think this page was the most helpful overall in identifying the most stuff in one place while I was getting things set up. My boolean/integer comparison functions are also from this page: http://www.postgresonline.com/journal/archives/24-Using-MS-Access-with-PostgreSQL.html Note that it recommends enabling the True=-1 option in the driver, but I don't appear to be running with that, so either it didn't make a difference, or it caused me problems, I can't be remember. But with the above, I'm not having any problems with Access working against the database, including using the boolean fields in filters or queries. -- David