Received: from bologna.nettuno.it (bologna.nettuno.it [193.43.2.1]) by hub.org (8.9.3/8.9.3) with ESMTP id LAA63542 for ; Fri, 1 Oct 1999 11:13:57 -0400 (EDT) (envelope-from jose@sferacarta.com) Received: from proxy.sferacarta.com (mail@sfcabop1.nettuno.it [193.207.10.213]) by bologna.nettuno.it (8.9.3/8.9.3/NETTuno 3.3) with ESMTP id RAA03594; Fri, 1 Oct 1999 17:13:51 +0200 (MDT) Received: from rosso.sferacarta.com (sferacarta.com) [10.20.30.5] by proxy.sferacarta.com with esmtp (Exim 2.05 #1 (Debian)) id 11X69B-0006hC-00; Fri, 1 Oct 1999 17:07:05 +0000 Message-ID: <37F4CFD9.422D4975@sferacarta.com> Date: Fri, 01 Oct 1999 17:14:33 +0200 From: jose soares X-Mailer: Mozilla 4.5 [it] (Win95; I) X-Accept-Language: it MIME-Version: 1.0 To: Moray McConnachie CC: postgresql-general Subject: Re: [GENERAL] ODBC-client->Linux-server: datatype boolean not recognized? References: <199909301033.MAA06992@mail.neroc.nl> <37F35BF3.862BC069@sferacarta.com> <01d101bf0b57$f4aaae70$760e01a3@oucs.ox.ac.uk> Content-Type: multipart/alternative; boundary="------------AD610E475538F2F54FD20B97" --------------AD610E475538F2F54FD20B97 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit oh! this was for old releases, now I'm using the following: create function MsBool(bool,int4) returns bool as ' declare bool_int int4; 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=MsBool, commutator='=', negator='!=', restrict=eqsel, join=eqjoinsel ); Moray McConnachie ha scritto: > >create function MsAccessBool(bool,int4) returns bool > > as '' language 'internal'; > > There is surely something missing here, between the empty single > quotes? When I execute that, I get "There is no internal function > msaccessbool" --------------AD610E475538F2F54FD20B97 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit oh! this was for old releases, now I'm using the following:

create function MsBool(bool,int4) returns bool as '
declare
        bool_int int4;
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=MsBool,
        commutator='=',
        negator='!=',
        restrict=eqsel,
        join=eqjoinsel
        );
 
 

Moray McConnachie ha scritto:

>create function MsAccessBool(bool,int4)  returns bool
>  as '' language 'internal';

There is surely something missing here, between the empty single
quotes? When I execute that, I get "There is no internal function
msaccessbool"

--------------AD610E475538F2F54FD20B97--