Smart string escaping in PostgreSQL
When inserting or updating string (varchar) fields that contains quotes use $$ instead of the regular ' '.
For example:
update table set description = $$ * User's loves "quotes" * $$
In the nasty case that your text contains $ signs, you can define your own tag like this:
update table set description = $escape_tag$ User's loves "quotes" and money $$ $escape_tag$
Written by Everton Maldonado
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Psql
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#