By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,302 Members | 3,621 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,302 IT Pros & Developers. It's quick & easy.

Any way to disable backslash as a string literal escape character?

P: n/a
I know this has been asked before - I've trawled through the mail archives and FAQs looking for any info, and only found "that's the way it works" answers.

Basically, I want to turn off backslash ( \ ) as an escape character in string literals. It makes porting apps to PostgreSQL much more difficult, because no major rdbms behaves this way (at least, none of Oracle, SQL Server,DB2, Sybase, Informix, SQL Anywhere or SQL Base ... the one's I've worked with). I know PostgreSQL isn't designed to be a clone of any of these, andI should love it the way it is :-) :-) :-), but this one quirk is annoyingthe hell out of me.

I'm guessing the answer will be no, because it would break things like nullhandling.

So, any postmaster switches, build/make options, etc.? Or should I get hacking myself?


The contents of this post are my opinions only
If swallowed seek medical advice

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
"Grant Allen" <Gr*********> writes:
Basically, I want to turn off backslash ( \ ) as an escape character
in string literals.

No can do without hacking backend code. But why are you more concerned
about backslash than, say, single-quote (')? I cannot envision any way
of embedding arbitrary strings into SQL commands that doesn't have some
kind of escape-character rule.

I suspect what you really need is a way to supply strings as out-of-line
parameters to SQL commands. This is available in PG as of 7.4, and I
think all the other major DBs had it long before.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.