Opened 16 years ago
Closed 16 years ago
#104 closed defect (fixed)
shp2pgsql is using deprecated PostgreSQL escape syntax
Reported by: | robe | Owned by: | robe |
---|---|---|---|
Priority: | low | Milestone: | |
Component: | postgis | Version: | |
Keywords: | Cc: |
Description (last modified by )
For some datasets I get this
HINT: Use the escape string syntax for backslashes, e.g., E'
'.
WARNING: nonstandard use of
in a string literal
LINE 1: ...w','St','Brighton','02135','Residential','3','R3','
2003
2...
Attachments (2)
Change History (10)
comment:1 by , 16 years ago
by , 16 years ago
comment:4 by , 16 years ago
Description: | modified (diff) |
---|---|
Resolution: | fixed |
Status: | closed → reopened |
I think the changes done in #123 r3989 broke this and worst yet, I can no longer import my sample file with either shp2pgsql or the shp2pgsql gui. Gives the annoying escape errors and also that I have invalid characters for SQL ASCII or some such thing. The -W latin1 also doesn't work.
Try attached file.
comment:5 by , 16 years ago
Thanks for the report Regina. Since I have standard_conforming_strings enabled on my installation, I missed the fact that I need to explicitly set this in the output file for people that don't. Should now be fixed in r3994 - please test your end and close if it works.
ATB,
Mark.
comment:6 by , 16 years ago
Mark, Well you partly fixed it. I can now import, BUT the gui still gives the warning
HINT: Use the escape string syntax for escapes, e.g., E'\r\n'. WARNING: nonstandard use of escape in a string literal LINE 1: ...,'Av','Roslindale','02131','Residential','3','R3','\2003\200... The shp2pgsql as far as I can tell is perfectly fine now, but I'll test with more shapefile loadings I have lying around.
comment:7 by , 16 years ago
Okay, it looks as if I missed part of the conversion, i.e. sprintf()s need to be changed to pgis_exec(). Can you try again now and see if works?
ATB,
Mark.
Try this micro-patch and see if it goes away...