as suggested by Josh Berkus.
SQL_ASCII
+ |
+
quote_ident(string text)
+ text
+
+ Returns the given string suitably quoted to be used as an identifier
+ in an SQL query string.
+ Quotes are added only if necessary (i.e., if the string contains
+ non-identifier characters or would be case-folded).
+ Embedded quotes are properly doubled.
+
+ quote_ident('Foo')
+ "Foo"
+
+
+ |
+
quote_literal(string text)
+ text
+
+ Returns the given string suitably quoted to be used as a literal
+ in an SQL query string.
+ Embedded quotes and backslashes are properly doubled.
+
+ quote_literal('O\'Reilly')
+ 'O''Reilly'
+
+
|
repeat(text, integer)
text