I'm looking for a way to take arbitrary strings, and quote them so that if they were included in an SQL statement for the PostGres database, they couldn't parse as anything other than a single string. I looked at quotemeta, but I don't think that does the right kind of quoting.