Re: [HACKERS] Help with casting and comparing.

2006-07-06 Thread Tzahi Fadida
On Thursday 06 July 2006 21:55, Martijn van Oosterhout wrote: > On Thu, Jul 06, 2006 at 07:43:20PM +0300, Tzahi Fadida wrote: > > The downside is that i noticed that the CTID is removed from the tuple > > if a cast occurs. Is there a way to tell postgresql to not remove the > > CTID? > > Err, the f

Re: [HACKERS] Help with casting and comparing.

2006-07-06 Thread Martijn van Oosterhout
On Thu, Jul 06, 2006 at 07:43:20PM +0300, Tzahi Fadida wrote: > The downside is that i noticed that the CTID is removed from the tuple > if a cast occurs. Is there a way to tell postgresql to not remove the > CTID? Err, the fact the ctid is removed is really just a side-effect. With no adjusting o

Re: [HACKERS] Help with casting and comparing.

2006-07-06 Thread Tzahi Fadida
I looked around in the code and the whole thing looks complex and prone to breaking my code often, i.e., whenever someone will decide to change the casting/operators. I thought about just issuing in SPI_prepare query the proper casting like: SELECT a0::text,a1::text ... Casting to equal types (whe

Re: [HACKERS] Help with casting and comparing.

2006-06-28 Thread Tom Lane
Martijn van Oosterhout writes: > On Wed, Jun 28, 2006 at 03:25:57PM +0300, Tzahi Fadida wrote: >> I need help finding out how to determine if two types are equality compatible >> and compare them. > Fortunatly the backend contains functions that do all this already. > Check out parser/parse_oper.

Re: [HACKERS] Help with casting and comparing.

2006-06-28 Thread Martijn van Oosterhout
On Wed, Jun 28, 2006 at 03:25:57PM +0300, Tzahi Fadida wrote: > Hi, > > I need help finding out how to determine if two types are equality compatible > and compare them. > 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

[HACKERS] Help with casting and comparing.

2006-06-28 Thread Tzahi Fadida
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