Seamus Abshere <seamus@abshere.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
Wow, there's a name I haven't seen in years. I used to deal with
him often when he was at Sybase, and once or twice after he moved
to Sun. Sharp guy.
> says we can implement something like:
>
> SELECT * FROM tbl WHERE data {postgres qm} 'abc'
That suggestion makes a lot of sense to me. The curly-brace
escapes are in JDBC for portability, so this seems like a totally
appropriate use; it's surprising it hasn't come up before.
> 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?
We already have code in the JDBC driver to recognize curly-brace
escape sequences. We just need to add "postgres" as another
keyword for such escapes and we can do what we like for the rest of
the escape sequence. A mnemonic, such as Lance suggests, does seem
like a good approach.
--
Kevin Grittner
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company