Help with casting and comparing.

From: Tzahi Fadida <Tzahi(dot)ML(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Help with casting and comparing.
Date: 2006-06-28 12:25:57
Message-ID: 200606281525.57716.Tzahi.ML@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I need help finding out how to determine if two types are equality compatible
and compare them.

I am using the following call to check for equality between two values:
DatumGetBool(\
FunctionCall2(&(fctx->tupleSetAttEQFunctions[attID]->eq_opr_finfo)\
, lvalue, rvalue))

The structure fctx->tupleSetAttEQFunctions[attID]->eq_opr_finfo currently
holds a reference to an equality function that is proper for the type of
lvalue and rvalue.

Currently i only allow two values only of the same type but i wish to allow
to compare values like "20.2"=?20.2 or 20=?20.0 etc...

The first step is to find out if two attributes are equality and casting
compatible, i.e., if one type can be cast to the other type so they can be
compared. Or, just equality compatible and the casting is done somehow behind
the scene.
Finally, i have to use a function to compare the two values.

--
Regards,
        Tzahi.
--
Tzahi Fadida
Blog: http://tzahi.blogsite.org | Home Site: http://tzahi.webhop.info
WARNING TO SPAMMERS:  see at
http://members.lycos.co.uk/my2nis/spamwarning.html

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Yoshiyuki Asaba 2006-06-28 12:27:42 Re: SO_SNDBUF size is small on win32?
Previous Message Thomas Hallgren 2006-06-28 11:56:47 Re: UUID's as primary keys