aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-06-24 22:17:01 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-06-24 22:17:01 +0000
commite11f1677185b1427b697652f7bb4fb08b1b80077 (patch)
treeeeeaf73fad05ca80cac1be53c358bc1c3c15eefd
parent12a28d12bb14686ecb43f1e36af51b33715d1cd3 (diff)
downloadpostgresql-e11f1677185b1427b697652f7bb4fb08b1b80077.tar.gz
postgresql-e11f1677185b1427b697652f7bb4fb08b1b80077.zip
Document quote_ident and quote_literal in the main list of string functions,
as suggested by Josh Berkus.
-rw-r--r--doc/src/sgml/func.sgml28
1 files changed, 27 insertions, 1 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 4c30789eff4..b32bcbaa82e 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -1,5 +1,5 @@
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.103 2002/06/15 20:03:51 momjian Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.104 2002/06/24 22:17:01 tgl Exp $
PostgreSQL documentation
-->
@@ -1082,6 +1082,32 @@ PostgreSQL documentation
</row>
<row>
+ <entry><function>quote_ident</function>(<parameter>string</parameter> text)</entry>
+ <entry><type>text</type></entry>
+ <entry>
+ 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.
+ </entry>
+ <entry><literal>quote_ident('Foo')</literal></entry>
+ <entry><literal>"Foo"</literal></entry>
+ </row>
+
+ <row>
+ <entry><function>quote_literal</function>(<parameter>string</parameter> text)</entry>
+ <entry><type>text</type></entry>
+ <entry>
+ Returns the given string suitably quoted to be used as a literal
+ in an SQL query string.
+ Embedded quotes and backslashes are properly doubled.
+ </entry>
+ <entry><literal>quote_literal('O\'Reilly')</literal></entry>
+ <entry><literal>'O''Reilly'</literal></entry>
+ </row>
+
+ <row>
<entry><function>repeat</function>(<type>text</type>, <type>integer</type>)</entry>
<entry><type>text</type></entry>
<entry>Repeat text a number of times.</entry>