From: | Craig Ringer <craig(at)2ndquadrant(dot)com> |
---|---|
To: | David Johnston <polobo(at)yahoo(dot)com>, pgsql-general(at)postgresql(dot)org, Merlin Göttlinger <megoettlinger(at)gmail(dot)com> |
Subject: | Re: Re: PostgreSQL specific datatypes very confusing for beginners who use wrappers around JDBC |
Date: | 2014-01-29 08:07:03 |
Message-ID: | 52E8B6A7.3080901@2ndquadrant.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On 01/29/2014 02:36 PM, David Johnston wrote:
>
> The "correct" solution would seem to be for ORMs to "bind unknown" against
> the input but only when the supplied string is meant to be a representation
> of a PostgreSQL type as opposed to being actual string data. The ORM is free
> to provide the necessary API to distinguish between the two and the caller
> has to know then database to call the proper method (i.e., not setString if
> your data intended for anything besides a text/varchar column).
I certainly agree that that's the ideal, and it's closer to achievable
than any other fix to these sorts of systems.
A challenge I've found when approaching this from the ORM side has been
getting people to care. The sentiment has tended to be along the lines
of: No other DBMS does this or requires this, why do we have to jump
through hoops just to make PostgreSQL happy?
I'm not claiming that's a good reason for inaction.
I think there's more hope of getting ORM systems to differentiate
between "unknown-typed literal" and "concrete text-typed literal" than
actually implementing proper support for Pg's numerous useful types. Not
much more hope, but some.
Look at the example that started this thread, though. The stack is:
PostgreSQL
PgJDBC
Java JDBC API
EBean ORM
Play! Framework
and *every level* needs to have a clue about this or a way to pass the
information trough transparently.
Now think about Hibernate, Sequel ORM, Django ORM, ActiveRecord,
EclipseLink, OpenJPA, DataMapper, Entity Framework, EBean, TopLink,
iBatis/MyBatis, Doctrine, Propel, CakePHP, Zend, SQLAlchemy, ....
Wouldn't it be nice if we could find a solution to this user pain point
in one place?
--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
From | Date | Subject | |
---|---|---|---|
Next Message | Florian Weimer | 2014-01-29 12:03:41 | Re: Re: PostgreSQL specific datatypes very confusing for beginners who use wrappers around JDBC |
Previous Message | Craig Ringer | 2014-01-29 07:05:23 | Re: PostgreSQL specific datatypes very confusing for beginners who use wrappers around JDBC |