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

From Heikki Linnakangas
Subject Re: Alias hstore's ? to ~ so that it works with JDBC
Date
Msg-id 511947EC.4090104@vmware.com
Whole thread Raw
In response to Re: Alias hstore's ? to ~ so that it works with JDBC  (Kris Jurka <books@ejurka.com>)
Responses Re: Alias hstore's ? to ~ so that it works with JDBC  (Seamus Abshere <seamus@abshere.net>)
List pgsql-hackers
On 08.02.2013 19:41, Kris Jurka wrote:
> On Fri, 8 Feb 2013, Dave Cramer wrote:
>
>> Would this be an postgresql specific escape sequence ? I don't think the
>> spec allows for this does it ?
>>
>
> Yes, this would be a postgresql jdbc driver specific escape.  The spec
> doesn't have a concept of private escape sequences, but that doesn't seem
> like the end of the world.  Clearly the user here is writing postgresql
> specific code to use hstore operators, so there's not a portability loss
> here.

I agree it's pretty dumb that there's currently no such escape. I think 
JDBC inherited that design mistake from ODBC. Fixing that would be a 
good idea.

That said, it occurs to me that there's one fairly simple thing we could 
also do in the backend. At the moment, unlike function and table names, 
operators cannot be quoted. It would be easy to allow this in the grammar:

select 1 operator("+") 1;

The operator(...) syntax already exists, but the operator inside it 
can't be quoted. It wouldn't create any conflicts to allow that.

- Heikki



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Re: Proposal for Allow postgresql.conf values to be changed via SQL [review]
Next
From: Pavel Stehule
Date:
Subject: Re: performance regression in 9.2 CTE with SRF function