Re: ECPG gets embedded quotes wrong
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-hackers@lists.postgresql.org
Cc: Michael Meskes <meskes@postgresql.org>
Date: 2020-10-22T17:34:24Z
Lists: pgsql-hackers
I wrote: > Poking at this further, I noticed that there's a semi-related bug > that this patch changes the behavior for, without fixing it exactly. > That has to do with use of a string literal as "execstring" in ECPG's > PREPARE ... FROM and EXECUTE IMMEDIATE commands. Right now, it > appears that there is simply no way to write a double quote as part > of the SQL command in this context. In the other thread, 1250kv pointed out that you can use an octal escape (\042) to get a quote mark. That's pretty grotty, but it does work in existing ECPG releases as well as with this patch. So now I think the best answer for this part is just to document that workaround. Given the lack of complaints up to now, it's definitely not worth the amount of trouble that'd be needed to have a cleaner solution. regards, tom lane
Commits
-
Add documentation and tests for quote marks in ECPG literal queries.
- c16a1bbcf498 14.0 landed
-
Avoid premature de-doubling of quote marks in ECPG strings.
- 3dfb1942d9b8 14.0 landed