agora inbox for postgres@postgres.berkeley.edu
help / color / mirror / Atom feedFrom: Robert.Patrick@cs.cmu.edu
To: postgres@postgres.Berkeley.EDU
Subject: < operator for bool
Date: Tue, 4 Oct 1994 21:35:16 -0400 (EDT)
Message-ID: <wiYU=IS00hMdIUgKdm@cs.cmu.edu> (raw)
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.
==============================================================================
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 using the --to and --cc options:
reply via email
To: postgres@postgres.berkeley.edu
Cc: Robert.Patrick@cs.cmu.edu
Subject: Re: < operator for bool
In-Reply-To: <wiYU=IS00hMdIUgKdm@cs.cmu.edu>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox