-
+
Server Configuration
This controls whether ordinary string literals
('...'>) treat backslashes literally, as specified in
the SQL standard.
- The default is currently off>, causing
-
PostgreSQL to have its historical
- behavior of treating backslashes as escape characters.
- The default will change to on> in a future release
- to improve compatibility with the SQL standard.
+ Beginning in
PostgreSQL 9.1, the default is
+ on> (prior releases defaulted to off>).
Applications can check this
parameter to determine how string literals will be processed.
The presence of this parameter can also be taken as an indication
-
+
SQL Syntax
If the configuration parameter
is off>,
then
PostgreSQL recognizes backslash escapes
- in both regular and escape string constants. This is for backward
- compatibility with the historical behavior, where backslash escapes
- were always recognized.
- Although standard_conforming_strings> currently defaults to
- off>, the default will change to on> in a future
- release for improved standards compliance. Applications are therefore
- encouraged to migrate away from using backslash escapes. If you need
- to use a backslash escape to represent a special character, write the
- string constant with an E> to be sure it will be handled the same
- way in future releases.
+ in both regular and escape string constants. However, as of
+
PostgreSQL> 9.1, the default is on>, meaning
+ that backslash escapes are recognized only in escape string constants.
+ This behavior is more standards-compliant, but might break applications
+ which rely on the historical behavior, where backslash escapes
+ were always recognized. As a workaround, you can set this parameter
+ to off>, but it is better to migrate away from using backslash
+ escapes. If you need to use a backslash escape to represent a special
+ character, write the string constant with an E>.
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/parser/scan.l,v 1.167 2010/05/30 18:10:41 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/scan.l,v 1.168 2010/07/20 00:34:44 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
*/
int backslash_quote = BACKSLASH_QUOTE_SAFE_ENCODING;
bool escape_string_warning = true;
-bool standard_conforming_strings = false;
+bool standard_conforming_strings = true;
/*
* Set the type of YYSTYPE.
* Written by Peter Eisentraut
.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.562 2010/07/16 22:25:50 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.563 2010/07/20 00:34:44 rhaas Exp $
*
*--------------------------------------------------------------------
*/
GUC_REPORT
},
&standard_conforming_strings,
- false, NULL, NULL
+ true, NULL, NULL
},
{
#escape_string_warning = on
#lo_compat_privileges = off
#sql_inheritance = on
-#standard_conforming_strings = off
+#standard_conforming_strings = on
#synchronize_seqscans = on
# - Other Platforms and Clients -