Re: Problems with question marks in operators (JDBC, ECPG, ...)

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Robert Haas <robertmhaas(at)gmail(dot)com>, Dave Cramer <pg(at)fastcrypt(dot)com>
Cc: Bruno Harbulot <bruno(at)distributedmatter(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Problems with question marks in operators (JDBC, ECPG, ...)
Date: 2015-05-15 21:49:38
Message-ID: 555669F2.6040406@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 05/15/2015 04:35 PM, Robert Haas wrote:
> I guess JDBC has the same problem as Perl and JavaScript here: ?
> signals a bind variable. The next question is, why isn't there some
> escaping mechanism for that, like writing ?? or \? or something?

FTR, Perl's DBD::Pg lets you do this:

$dbh->{pg_placeholder_dollaronly} = 1; # disable ? placeholders
$sth = $dbh->prepare(q{SELECT * FROM mytable WHERE lseg1 ?# lseg2
AND name = $1});
$sth->execute('segname');

cheers

andrew

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2015-05-15 22:06:12 Re: Final Patch for GROUPING SETS
Previous Message Alexander Korotkov 2015-05-15 21:48:22 Re: KNN-GiST with recheck