Re: Alias hstore's ? to ~ so that it works with JDBC - Mailing list pgsql-hackers

From Merlin Moncure
Subject Re: Alias hstore's ? to ~ so that it works with JDBC
Date
Msg-id CAHyXU0xb00_C3hS686F_1NQ87kAGRAv_FKhZs8F1uhuNkQXKbQ@mail.gmail.com
Whole thread Raw
In response to Alias hstore's ? to ~ so that it works with JDBC  (Seamus Abshere <seamus@abshere.net>)
Responses Re: Alias hstore's ? to ~ so that it works with JDBC  (Andrew Dunstan <andrew@dunslane.net>)
Re: Alias hstore's ? to ~ so that it works with JDBC  (Seamus Abshere <seamus@abshere.net>)
List pgsql-hackers
On Wed, Feb 6, 2013 at 11:20 AM, Seamus Abshere <seamus@abshere.net> wrote:
> merlin,
>
> Yes, you're correct, my phrasing was bad: all I meant was that it was a
> conflict, not a bug in Postgres or hstore.
>
> I personally don't know of any way around the conflict except changing JDBC
> or hstore, and I don't think JDBC is gonna change.
>
> Deciding not to accommodate JDBC on the Postgres side, though, is going to
> prevent hstore from being used properly with Java or any JVM-based language
> like JRuby.
>
> Please let me know if my assumptions are wrong.

This problem is not unique to ? character.  Hibernate for example
reserves the use of : character for name parameter insertion with
similarly ridiculous results.  Basically every language I know of
except for the java stack seems to understand that when embedding
constructs into a foreign language there must be some type of escaping
mechanism (note they may in fact allow this in some level: via
googling it isn't clear).

The point is that Postgres should not introduce language constraints
because of broken driver technology.  To move forward in your
particular case, consider:
*) switching to 'hstore defined()' function:
*) hacking pg_operator (carefully look up and change oprname for the
specific hstore operator)

merlin



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: sql_drop Event Trigger
Next
From: Robert Haas
Date:
Subject: Re: proposal: ANSI SQL 2011 syntax for named parameters