On 6 Dec 2011, at 11:56, Dominique Guardiola wrote:
> I'm trying to make a join between two columns, but one is a text and the 
> other an integer.
> I get a standard : 
> ERROR: operator does not exist: integer = text:

Is that a Postgres-specific error? I've not come across this before – SQL 
engines are supposed to cast implicitly where required.

> I read the manual this time and found that d2rq:numericColumn could be used 
> if "the engine is for some reason unable to determine the correct column type 
> by itself".
> 
> I suppose that means that in a normal setup (D2RQ and PostgreSQL talking 
> politely to each other), my d2rq:numericColumn setting is ignored

d2rq:numericColumn doesn't help here, it just affects quoting/escaping of 
generated SQL queries.

> I did not find any way in the docs to do somehting like CAST(table.column AS 
> INTEGER) to use it within dr2q:join statement.

No, d2rq:join is limited to simple equality.

> Is table schema modification the only solution in my case ?

Googling shows that there might be some Postgres magic to re-add the implicit 
casts:
http://www.depesz.com/index.php/2008/05/05/error-operator-does-not-exist-integer-text-how-to-fix-it/

You might also try using a d2rq:condition instead of a d2rq:join, but this will 
not always work because d2rq:condition doesn't know about the table-connecting 
semantics of joins.

Best,
Richard



> 
> thanks
> 
> --
> Dominique Guardiola, QUINODE
> • http://www.quinode.fr/
> • Tel : 04.27.86.84.37
> • Mob : 06.15.13.22.27
> 
> 
> 
> 
> 
> 
> ------------------------------------------------------------------------------
> Cloud Services Checklist: Pricing and Packaging Optimization
> This white paper is intended to serve as a reference, checklist and point of 
> discussion for anyone considering optimizing the pricing and packaging model 
> of a cloud services business. Read Now!
> http://www.accelacomm.com/jaw/sfnl/114/51491232/
> _______________________________________________
> d2rq-map-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel


------------------------------------------------------------------------------
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
_______________________________________________
d2rq-map-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel

Reply via email to