I'm porting an Access database to Postgres but keeping Access as the client.
I have been having problems with checkboxes and so I did some searching and
came across information that told me to uncheck Bools as Char in the ODBC
driver settings, I did that and started getting the following error:
ERROR: Unable to identify an operator '=' for types 'boolean' and 'integer'
You will have to retype this query using an explicit cast
So after some more searching I came across a message talking about adding
the function and an operator below to handle this problem:
CREATE FUNCTION MsAccessBool (bool, int4) RETURNS BOOL AS '
BEGIN
IF $1 IS NULL 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);
So I did this, and now I'm getting the "fmgr_info: function 0: cache lookup
failed" message. I've again done some looking and the only thing I've found
is a message that talks about the oprrest and oprjoin fields in the
pg_operator table, but not what I need to do with them. Any help would be
greatly appreciated.
Thanks,
Rob