Help with casting and comparing. - Mailing list pgsql-hackers

From Tzahi Fadida
Subject Help with casting and comparing.
Date
Msg-id 200606281525.57716.Tzahi.ML@gmail.com
Whole thread Raw
Responses Re: Help with casting and comparing.  (Martijn van Oosterhout <kleptog@svana.org>)
List 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


pgsql-hackers by date:

Previous
From: Teodor Sigaev
Date:
Subject: Re: GIN index creation extremely slow ?
Next
From: Yoshiyuki Asaba
Date:
Subject: Re: SO_SNDBUF size is small on win32?