*** pgsql/doc/src/sgml/func.sgml 2008/03/10 12:39:22 1.424 --- pgsql/doc/src/sgml/func.sgml 2008/03/23 00:24:19 1.425 *************** *** 1,4 **** ! Functions and Operators --- 1,4 ---- ! Functions and Operators *************** *** 1263,1268 **** --- 1263,1271 ---- quote_literal + quote_nullable + + repeat *************** *** 1523,1528 **** --- 1526,1532 ---- 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. + See also . quote_ident('Foo bar') "Foo bar" *************** *** 1535,1540 **** --- 1539,1548 ---- Return the given string suitably quoted to be used as a string literal in an SQL statement string. Embedded single-quotes and backslashes are properly doubled. + Note that quote_literal returns null on null + input; if the argument might be null, + quote_nullable is often more suitable. + See also . quote_literal('O\'Reilly') 'O''Reilly' *************** *** 1551,1556 **** --- 1559,1590 ---- '42.5' + + quote_nullable(string text) + text + + Return the given string suitably quoted to be used as a string literal + in an SQL statement string; or, if the argument + is null, return NULL. + Embedded single-quotes and backslashes are properly doubled. + See also . + + quote_nullable(NULL) + NULL + + + + quote_nullable(value anyelement) + text + + Coerce the given value to text and then quote it as a literal; + or, if the argument is null, return NULL. + Embedded single-quotes and backslashes are properly doubled. + + quote_nullable(42.5) + '42.5' + + regexp_matches(string text, pattern text [, flags text]) setof text[]