Re: Alias hstore's ? to ~ so that it works with JDBC

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Seamus Abshere <seamus(at)abshere(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Alias hstore's ? to ~ so that it works with JDBC
Date: 2013-02-06 17:34:30
Message-ID: CAHyXU0xb00_C3hS686F_1NQ87kAGRAv_FKhZs8F1uhuNkQXKbQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Feb 6, 2013 at 11:20 AM, Seamus Abshere <seamus(at)abshere(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2013-02-06 17:43:18 Re: proposal: ANSI SQL 2011 syntax for named parameters
Previous Message Robert Haas 2013-02-06 17:33:47 Re: sql_drop Event Trigger