From 291f737ab9074b0a89633aaf69468110e0559334 Mon Sep 17 00:00:00 2001 From: Andreas Scherbaum Date: Sat, 7 May 2016 00:08:39 +0200 Subject: [PATCH] Change the default value of standard_conforming_strings to on This change should be publicized to driver maintainers at once and release-noted as an incompatibility with previous releases. (cherry picked from commit 0839f312e92c7ab0aecb2c4133197a7da7c5fc39) Changes to doc/src/sgml/{config,syntax}.sgml ignored as they are not present in gpdb. --- src/backend/parser/scan.l | 4 ++-- src/backend/utils/misc/guc.c | 4 ++-- src/backend/utils/misc/postgresql.conf.sample | 2 +- src/test/regress/bugbuster/expected/xpath.out | 12 ++---------- src/test/regress/bugbuster/sql/xpath.sql | 4 ++-- src/test/regress/expected/gpcopy.out | 6 +----- src/test/regress/sql/gpcopy.sql | 2 +- 7 files changed, 11 insertions(+), 23 deletions(-) diff --git a/src/backend/parser/scan.l b/src/backend/parser/scan.l index d83fed1a54..ef50475048 100755 --- a/src/backend/parser/scan.l +++ b/src/backend/parser/scan.l @@ -24,7 +24,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/parser/scan.l,v 1.153 2009/05/05 21:09:23 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/parser/scan.l,v 1.168 2010/07/20 00:34:44 rhaas Exp $ * *------------------------------------------------------------------------- */ @@ -76,7 +76,7 @@ static uint32 utf16_top_part; */ int backslash_quote = BACKSLASH_QUOTE_SAFE_ENCODING; bool escape_string_warning = true; -bool standard_conforming_strings = false; +bool standard_conforming_strings = true; static bool warn_on_first_escape; static bool saw_non_ascii = false; diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index 14f7de8aea..96399c180d 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -11,7 +11,7 @@ * Written by Peter Eisentraut . * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.385 2007/04/16 18:29:55 alvherre Exp $ + * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.563 2010/07/20 00:34:44 rhaas Exp $ * *-------------------------------------------------------------------- */ @@ -1053,7 +1053,7 @@ static struct config_bool ConfigureNamesBool[] = GUC_REPORT }, &standard_conforming_strings, - false, NULL, NULL + true, NULL, NULL }, { diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample index eb04f46688..198eab57c1 100755 --- a/src/backend/utils/misc/postgresql.conf.sample +++ b/src/backend/utils/misc/postgresql.conf.sample @@ -495,7 +495,7 @@ max_appendonly_tables = 10000 # Maximum number of append only tables that can #backslash_quote = safe_encoding # on, off, or safe_encoding #escape_string_warning = on #regex_flavor = advanced # advanced, extended, or basic -#standard_conforming_strings = off +#standard_conforming_strings = on # - Other Platforms and Clients - diff --git a/src/test/regress/bugbuster/expected/xpath.out b/src/test/regress/bugbuster/expected/xpath.out index 7dc7fbd9fe..dbc830560b 100644 --- a/src/test/regress/bugbuster/expected/xpath.out +++ b/src/test/regress/bugbuster/expected/xpath.out @@ -284,11 +284,7 @@ DETAIL: Entity: line 1: parser error : Premature end of data in tag a line 1 Entity: line 1: parser error : Premature end of data in tag a line 1 hello ^ -select xmlcomment('hello<\a>'); -WARNING: nonstandard use of escape in a string literal -LINE 1: select xmlcomment('hello<\a>'); - ^ -HINT: Use the escape string syntax for escapes, e.g., E'\r\n'. +select xmlcomment(E'hello<\a>'); xmlcomment -------------------- @@ -300,11 +296,7 @@ select xmlcomment('adsfasdfasdfsadf'); (1 row) -select xmlcomment('\n'); -WARNING: nonstandard use of escape in a string literal -LINE 1: select xmlcomment('\n'); - ^ -HINT: Use the escape string syntax for escapes, e.g., E'\r\n'. +select xmlcomment(E'\n'); xmlcomment ------------