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

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: Seamus Abshere <seamus(at)abshere(dot)net>
Cc: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Kris Jurka <books(at)ejurka(dot)com>, Merlin Moncure <mmoncure(at)gmail(dot)com>
Subject: Re: Alias hstore's ? to ~ so that it works with JDBC
Date: 2013-02-13 17:13:39
Message-ID: CADK3HHJO0Xv2Wu4DzFmGdOyAshuUtjNk4X=dChZo+M-m1pqY5Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Since we already do escape processing much like c that might not be so
complex. However I haven't looked at the code, so I could be way off base.

The question I would pose is how palatable is it to use ? In other words is
it worth pursuing ?

Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca

On Wed, Feb 13, 2013 at 12:10 PM, Seamus Abshere <seamus(at)abshere(dot)net> wrote:

> On 2/11/13 1:35 PM, Heikki Linnakangas wrote:
>
>> 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.
>>
>
> Lance Anderson, Oracle's JDBC spec lead, says [1] we can implement
> something like:
>
> SELECT * FROM tbl WHERE data {postgres qm} 'abc'
>
> Thanks to Mark Rotteveel for driving the discussion. [2]
>
>
> 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;
>>
>
> I guess I see 2 simple options and 1 complex option:
>
> a) [simple] operator("+") per Heikki
> b) [simple, but not popular] alias ? to ~ per Seamus
> c) [complex] {postgres blah} per Lance/Mark
>
> How to decide?
>
> Best,
> Seamus
>
>
> [1] http://mail.openjdk.java.net/**pipermail/jdbc-spec-discuss/**
> 2013-February/000058.html<http://mail.openjdk.java.net/pipermail/jdbc-spec-discuss/2013-February/000058.html>
> [2] http://mail.openjdk.java.net/**pipermail/jdbc-spec-discuss/**
> 2013-February/date.html#51<http://mail.openjdk.java.net/pipermail/jdbc-spec-discuss/2013-February/date.html#51>(threaded view gets it out of order)
>
>
>
> --
> Seamus Abshere
> seamus(at)abshere(dot)net
> https://github.com/**seamusabshere <https://github.com/seamusabshere>
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2013-02-13 17:25:25 Re: JSON Function Bike Shedding
Previous Message Seamus Abshere 2013-02-13 17:10:17 Re: Alias hstore's ? to ~ so that it works with JDBC