Postgres Escape Strings
Reported by Ana Nelson | June 23rd, 2008 @ 04:31 PM
When I try to run the attached script, I get:
WARNING: nonstandard use of \\ in a string literal
LINE 1: INSERT INTO "examples" ("example") VALUES ('xx\\xx') RETURNI...
^
HINT: Use the escape string syntax for backslashes, e.g., E'\\'.
This is just a warning, not an error. The code does run properly and the record is added to the database
Postgres seems to have its own escape-string notation.
Comments and changes to this ticket
-
Sam Smoot June 23rd, 2008 @ 04:49 PM
- → Assigned user changed from Sam Smoot to Bernerd Schaefer
That's odd. I swear we're using the Postgres C-API string escaping to avoid these exact issues. :-/
Maybe it's just that the C-API wasn't updated to match the new E'\\' syntax? (It's new in 8.3 right?)
Bernerd? Can you confirm? If we are, then I'd say probably just ignore the warning and as the Postgres team updates the client libs, it'll go away. If we aren't using the C-API for escaping, we should be, but let me know first because it's going to be a busy week so we'll need to schedule the fix.
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
