Repository navigation
PG/PGDump: Handle backslash in StringList - #15429
Conversation
Inside pg array literals both " and \ are special, but the function only escaped "
|
Can you add a simple test case that I could run with ogr2ogr? |
It needs PG to show it easiest Or using pgdump that prints |
|
Sorry, I am not a programmer and the examples are a bit hard for me to follow. I tried to make a comparison with native tools. I tried to insert an array of two strings which remind common Windows paths Then
The dumptest.sql file contains now
while output from
Is my test valid? Does it match with your test? I wonder if it would be good to open also a GitHub ticket with a compact description about what has been wrong. Then the the fix could be included into the release news. It may be that some users have created workarounds. |
|
@jratike80 I like your example data, and I think it demonstrates a second bug. Suppose we have on with this PR, it succeeds and the table appears to have the correct contents However, if we try to convert from PG->PGDUMP, we get incorrect data: But we get the expected result when converting GeoJSON->PGUMP: So I think there is an issue when reading from Postgres, completely separate from the issue addressed by this PR. What do you think? |
That issue --> #15430 |
What does this PR do?
Inside pg array literals both " and \ are special, but the function only escaped " this pr adds the backslash so its escaped properly in the output.
What are related issues/pull requests?
AI tool usage
Claude found this issue while working with ogr2ogr and concluded its the backslash. I added the code in ogrpgdumplayer.cpp myself
Tasklist
Environment
Provide environment details, if relevant: