Subject: < operator for bool

From: [email-masked]
Date: Tue, 4 Oct 1994 21:35:16 -0400 (EDT)

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 "[email-masked]"

   If this fails, send mail to "[email-masked]" and
   a human will deal with it.  DO NOT post to the "postgres" mailing list.
==============================================================================