pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff Eckermann <jeff_eckermann@yahoo.com>
To: Fred Parkinson <FredP@abag.ca.gov>
To: pgsql-odbc@postgresql.org
Subject: Re: Only fails when logging is off
Date: Thu, 20 Feb 2003 12:34:59 -0800 (PST)
Message-ID: <20030220203500.33841.qmail@web20805.mail.yahoo.com> (raw)
In-Reply-To: <se549d65.080@groupwise.abag.ca.gov>

--- Fred Parkinson <FredP@abag.ca.gov> wrote:
> Here is a problem that disappears when logging is
> on:

What version of PostgreSQL is this?

> 2. ERROR: Unable to identify an operator "=" for
> types "boolean" and "integer"
>    You will have to retype this query using an
> explicit cast (#7)
> 
Sounds like an old problem.  Try running the following
code in in PostgreSQL:

CREATE FUNCTION MsAccessBool (bool, int4) RETURNS BOOL
AS '
BEGIN
  IF $1 ISNULL THEN
    RETURN NULL;
  END IF;

  IF $1 IS TRUE THEN
    IF $2 <> 0 THEN
      RETURN TRUE;
    END IF;
  ELSE
    IF $2 = 0 THEN
      RETURN TRUE;
    END IF;
  END IF;
  RETURN FALSE;
END;
' LANGUAGE 'plpgsql';

CREATE OPERATOR = (
  LEFTARG = BOOL,
  RIGHTARG = INT4,
  PROCEDURE = MsAccessBool,
  COMMUTATOR = '=',
  NEGATOR = '<>',
  RESTRICT = EQSEL,
  JOIN = EQJOINSEL
);

If this doesn't help you, please post your ODBC driver
settings.  I assume these are boolean fields in
PostgreSQL: they should show as "yes/no" in Access. 
If they do not, try relinking your tables after
running the above code.


__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/



view thread (2+ messages)

Message-ID: <20030220203500.33841.qmail@web20805.mail.yahoo.com>
Permalink:  ../20030220203500.33841.qmail@web20805.mail.yahoo.com/
Also on:    postgresql.org/message-id/20030220203500.33841.qmail@web20805.mail.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: jeff_eckermann@yahoo.com, FredP@abag.ca.gov
  Subject: Re: Only fails when logging is off
  In-Reply-To: <20030220203500.33841.qmail@web20805.mail.yahoo.com>
  References: <se549d65.080@groupwise.abag.ca.gov> <20030220203500.33841.qmail@web20805.mail.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox