Return-Path: owner-postman
Received: from localhost.Berkeley.EDU (localhost.Berkeley.EDU [127.0.0.1]) by nobozo.CS.Berkeley.EDU (8.6.9/8.6.3) with SMTP id SAA29766 for postgres-redist; Tue, 4 Oct 1994 18:35:55 -0700
Resent-From: POSTGRES mailing list <postman@postgres.Berkeley.EDU>
Resent-Message-Id: <199410050135.SAA29766@nobozo.CS.Berkeley.EDU>
X-Authentication-Warning: nobozo.CS.Berkeley.EDU: Host localhost.Berkeley.EDU didn't use HELO protocol
Sender: owner-postman@postgres.Berkeley.EDU
X-Return-Path: owner-postman
Received: from EIGER.EDRC.CMU.EDU (EIGER.EDRC.CMU.EDU [128.2.214.41]) by nobozo.CS.Berkeley.EDU (8.6.9/8.6.3) with SMTP id SAA29756 for <postgres@nobozo.CS.BERKELEY.EDU>; Tue, 4 Oct 1994 18:35:54 -0700
Received: from Messages.8.5.N.CUILIB.3.45.SNAP.NOT.LINKED.EIGER.EDRC.CMU.EDU.pmax.mach
          via MS.5.6.EIGER.EDRC.CMU.EDU.pmax_mach;
          Tue,  4 Oct 1994 21:35:16 -0400 (EDT)
Message-ID: <wiYU=IS00hMdIUgKdm@cs.cmu.edu>
Date: Tue,  4 Oct 1994 21:35:16 -0400 (EDT)
From: Robert.Patrick@cs.cmu.edu
To: postgres@postgres.Berkeley.EDU
Subject: < operator for bool
Resent-To: postgres-redist@postgres.Berkeley.EDU
Resent-Date: Tue, 04 Oct 94 18:35:55 -0700
Resent-XMts: smtp

I wrote the following piece of C code to implement the < operator for
bool types in Postgres (so that I could use retrieve unique on tables
with boolean attributes).

#include "tmp/c.h"

int32
boollt (arg1, arg2)
     int8 arg1;
     int8 arg2;
{
  return (arg1 == false && arg2 == true);
}

My current version is modelled after the code for the = operator for
booleans.  I have tried changing the argument and return types to all
sorts of different combinations involving types bool, int, and char.

Now, I define the function as follows:

define function bool_lt
	(language = "c", returntype = int4)
	arg is (bool, bool)
	as "/usr0/rp2y/obj/bool_lt.o"

I define the operator as follows:

define operator <
	(arg1 = bool, arg2 = bool, procedure = bool_lt)

Now, when I try to do the following query, the backend goes off and
never comes back.  I can type Control-C to get back the Unix prompt but
I have to explicitly kill the backend process which continues to run
forever.

retrieve unique (models.all)

The models class is defined as follows

create models (id = text, createTime = int4, modTime = int4, 
	published = bool, title = text, atomType = text)

Where did I go wrong?

Thanks,
Robert

==============================================================================
   To add/remove yourself to/from the POSTGRES mailing list: send mail with 
   the subject line ADD or DEL to "postgres-request@postgres.Berkeley.EDU"

   If this fails, send mail to "post_questions@postgres.Berkeley.EDU" and
   a human will deal with it.  DO NOT post to the "postgres" mailing list.
==============================================================================
