From 3f899642340a9f5de946af50152a529aac5e57bb Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 27 Nov 2007 18:29:11 +0000 Subject: Add quote_literal(anyelement) to preserve (and, in fact, extend) a useful consequence of the former liberal implicit casting to text; namely that you can feed non-string values to quote_literal() and get unsurprising results. Per discussion. --- doc/src/sgml/func.sgml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 24b1931caea..a3baee14489 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -1,4 +1,4 @@ - + Functions and Operators @@ -1514,7 +1514,7 @@ - quote_ident(string) + quote_ident(string text) text Return the given string suitably quoted to be used as an identifier @@ -1528,7 +1528,7 @@ - quote_literal(string) + quote_literal(string text) text Return the given string suitably quoted to be used as a string literal @@ -1539,6 +1539,17 @@ 'O''Reilly' + + quote_literal(value anyelement) + text + + Coerce the given value to text and then quote it as a literal. + Embedded single-quotes and backslashes are properly doubled. + + quote_literal(42.5) + '42.5' + + regexp_matches(string text, pattern text [, flags text]) setof text[] -- cgit v1.2.3