Re: Escaping placeholders, take 2

2015-01-09 Thread Tim Bunce
On Fri, Jan 09, 2015 at 02:54:56PM -, Greg Sabino Mullane wrote: > > Just a heads up to this list - support for backslash-escaped placeholders > is now implemented in the current production version of DBD::Pg, 3.5.0 > > http://search.cpan.org/dist/DBD-Pg/ > > http://cpansearch.perl.org/src/

Re: Escaping placeholders, take 2

2015-01-09 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 Just a heads up to this list - support for backslash-escaped placeholders is now implemented in the current production version of DBD::Pg, 3.5.0 http://search.cpan.org/dist/DBD-Pg/ http://cpansearch.perl.org/src/TURNSTEP/DBD-Pg-3.5.0/Changes

Re: Escaping placeholders, take 2

2015-01-02 Thread Tim Bunce
On Wed, Dec 31, 2014 at 03:55:42AM -, Greg Sabino Mullane wrote: > > Tim Bunce wrote: > > Wherein I attempt to summarize the requirements, the background, the > > options, > > the risks, and the counter-proposal ... > > Thanks for taking the time to write all this out in a coherent manner.

Re: Escaping placeholders, take 2

2014-12-30 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 Tim Bunce wrote: > Wherein I attempt to summarize the requirements, the background, the options, > the risks, and the counter-proposal ... Thanks for taking the time to write all this out in a coherent manner. I may once again assume the role o

Re: Escaping placeholders, take 2

2014-12-30 Thread Ron Savage
Hi All My apologies. Instead of Text::Balanced::Marpa, I should have pointed you to MarpaX::Languages::SQL2003::AST. Here, AST is Abstract syntax tree. See https://en.wikipedia.org/wiki/Abstract_syntax_tree. -- Ron Savage - savage.net.au

Re: Escaping placeholders, take 2

2014-12-29 Thread David E. Wheeler
On Dec 28, 2014, at 5:49 AM, Tim Bunce wrote: > Question marks are the international standard for placeholders. > The DBI should have specified a way to escape them from the start. > I'm attempting to fix that now. +1 David smime.p7s Description: S/MIME cryptographic signature

Re: Escaping placeholders, take 2

2014-12-28 Thread Ron Savage
Hi Darren On 29/12/14 13:59, Darren Duncan wrote: The API could involve an 'attr' given when preparing a SQL statement or other appropriate places. placeholder_escape_delimiters => [ '\{','}' ] placeholder_escape_delimiters => [ '\{','}','\[',']' ] placeholder_escape_delimiters => [ '

Re: Escaping placeholders, take 2

2014-12-28 Thread Darren Duncan
Thank you for this post Tim, it seemed to lay out the issues well and make a lot of things clear. I'm now inclined to support your backslash-escape proposal at the DBI driver level in principle. (I also agree that the doubling method is nasty.) Or alternately I suggest variation on that prop

Re: Escaping placeholders (was: [Dbix-class] Using Postgres JSONB operators in queries)

2014-12-24 Thread Tim Bunce
Sometime over the holiday period I hope to write up a summary of the arguments for and against and suggest ways forwards. Tim.

Re: Escaping placeholders

2014-12-23 Thread Martin J. Evans
On 22/12/2014 00:39, Darren Duncan wrote: I agree with Greg's counter-proposal, from which I derive my own words here. 1. I propose that there be no modification to the DBI spec related to new escaping whether optional or not, so leave things the way they are here, SQL continues to be interpret

Re: Escaping placeholders

2014-12-22 Thread Jens Rehsack
Am 20.12.2014 um 23:10 schrieb Tim Bunce : > On Sat, Dec 20, 2014 at 05:35:55PM +0100, Alexander Foken wrote: >> On 20.12.2014 15:38, Tim Bunce wrote: >>> Can you, or anyone else, think of any situation where a backslash before >>> a ? or :foo (or even $1) style placeholder might be valid SQL? >>

Re: Escaping placeholders

2014-12-21 Thread Darren Duncan
I agree with Greg's counter-proposal, from which I derive my own words here. 1. I propose that there be no modification to the DBI spec related to new escaping whether optional or not, so leave things the way they are here, SQL continues to be interpreted the way it long has by default. 2.

Re: Escaping placeholders

2014-12-21 Thread Greg Sabino Mullane (the tenth man)
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 Tim Bunce wrote: > For code not using DBIx::Class the pg_placeholder_dollaronly attribute > might work, see https://metacpan.org/pod/DBD::Pg#Placeholders Yes, this is the current canonical solution. It's a real shame that ? was used as an ope

Re: Escaping placeholders

2014-12-21 Thread Tim Bunce
On Sun, Dec 21, 2014 at 10:27:18AM +0100, pe...@vanroose.be wrote: > On 20.12.2014 15:38, Tim Bunce wrote: > > [...] > > Can you, or anyone else, think of any situation where a backslash before > > a ? or :foo (or even $1) style placeholder might be valid SQL? > > Inside quoted text: of course, ye

Re: Escaping placeholders

2014-12-21 Thread Alexander Foken
On 20.12.2014 23:10, Tim Bunce wrote: On Sat, Dec 20, 2014 at 05:35:55PM +0100, Alexander Foken wrote: On 20.12.2014 15:38, Tim Bunce wrote: Can you, or anyone else, think of any situation where a backslash before a ? or :foo (or even $1) style placeholder might be valid SQL? [...] Do you pla

Re: Escaping placeholders

2014-12-21 Thread Tim Bunce
On Sat, Dec 20, 2014 at 02:23:43PM -0800, Jonathan Leffler wrote: > > INSERT INTO SomeTable(DateTimeCol) > VALUES(DATETIME[1](2014-12-31 23\:59\:59) YEAR TO SECOND); > >I really won't want people have to futz with their legitimate Informix SQL > in order to pass it thro

Re: Escaping placeholders

2014-12-21 Thread peter
On 20.12.2014 15:38, Tim Bunce wrote: > [...] > Can you, or anyone else, think of any situation where a backslash before > a ? or :foo (or even $1) style placeholder might be valid SQL? Inside quoted text: of course, yes. Outside quoted text: maybe some RDBMS accept a backslash as a valid characte

Re: Escaping placeholders

2014-12-20 Thread Jonathan Leffler
Gmail hid the line you gave (as if it was the same as something I'd sent — curious behaviour by Gmail): INSERT INTO SomeTable(DateTimeCol) VALUES(DATETIME(2014-12-31 23\:59\:59) YEAR TO SECOND); I really won't want people have to futz with their legitimate Informix SQL in order to p

Re: Escaping placeholders

2014-12-20 Thread Tim Bunce
On Sat, Dec 20, 2014 at 01:14:29PM -0800, Jonathan Leffler wrote: >Many, many years ago, DBD::Informix had to give up on the DBI-provided > parsing for placeholders because >there were too many contexts in which it was wrong for Informix. It may > have improved since then, but: > >

Re: Escaping placeholders

2014-12-20 Thread Tim Bunce
On Sat, Dec 20, 2014 at 05:35:55PM +0100, Alexander Foken wrote: > On 20.12.2014 15:38, Tim Bunce wrote: > >Can you, or anyone else, think of any situation where a backslash before > >a ? or :foo (or even $1) style placeholder might be valid SQL? > > I found two situations for PostgreSQL: > > (1)

Re: Escaping placeholders

2014-12-20 Thread Jonathan Leffler
Many, many years ago, DBD::Informix had to give up on the DBI-provided parsing for placeholders because there were too many contexts in which it was wrong for Informix. It may have improved since then, but: INSERT INTO SomeTable(DateTimeCol) VALUES(DATETIME(2014-12-31 23:59:59) YEAR T

Re: Escaping placeholders

2014-12-20 Thread Alexander Foken
On 20.12.2014 15:38, Tim Bunce wrote: On Fri, Dec 19, 2014 at 01:12:16PM +0100, Alexander Foken wrote: Hello all, this reminds me of a similar problem I had in 2000 with DBI, DBD::Oracle, and Oracle. See ,

Re: Escaping placeholders

2014-12-20 Thread Tim Bunce
On Fri, Dec 19, 2014 at 01:12:16PM +0100, Alexander Foken wrote: > Hello all, > > this reminds me of a similar problem I had in 2000 with DBI, > DBD::Oracle, and Oracle. See > , > . > > Problem was u

Re: Escaping placeholders

2014-12-20 Thread Tim Bunce
Thanks David :) Tim. On Fri, Dec 19, 2014 at 12:23:23PM -0600, David Nicol wrote: >Please disregard my previous. After reading Tim Bunce's earlier response > and thinking about this some >more, although backslash escaping can be tricky, that is how Perl does > these things, and Perl cod

Re: Escaping placeholders

2014-12-19 Thread David Nicol
Please disregard my previous. After reading Tim Bunce's earlier response and thinking about this some more, although backslash escaping can be tricky, that is how Perl does these things, and Perl coders are familiar with the nuances of when they must be doubled to get through quoting. Doubling of s

Re: Escaping placeholders

2014-12-19 Thread David Nicol
On Fri, Dec 19, 2014 at 6:12 AM, Alexander Foken wrote: > > Problem was using named placeholders (":foo") in DBI and at the same time > use PL/SQL code containing variables (":bar"), DBI considered both ":foo" > and ":bar" to be placeholders instead of leaving ":bar" alone and pass it > to Oracle

Re: Escaping placeholders

2014-12-19 Thread Alexander Foken
Hello all, this reminds me of a similar problem I had in 2000 with DBI, DBD::Oracle, and Oracle. See , . Problem was using named placeholders (":foo") in DBI and at the same time use PL/SQL cod