diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 000000000000..73f69e095861
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
+# Editor-based HTTP Client requests
+/httpRequests/
diff --git a/.idea/cockroach.iml b/.idea/cockroach.iml
new file mode 100644
index 000000000000..c956989b29ad
--- /dev/null
+++ b/.idea/cockroach.iml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
new file mode 100644
index 000000000000..03d9549ea8e4
--- /dev/null
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 000000000000..bbb98589587f
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 000000000000..94a25f7f4cb4
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pkg/sql/logictest/testdata/logic_test/set b/pkg/sql/logictest/testdata/logic_test/set
index f9207f9ecc2a..bbee3f9e0d02 100644
--- a/pkg/sql/logictest/testdata/logic_test/set
+++ b/pkg/sql/logictest/testdata/logic_test/set
@@ -476,3 +476,20 @@ SET standard_conforming_strings='true'
statement ok
SET standard_conforming_strings='on'
+
+
+subtest backslash_quote_test
+
+statement ok
+SET backslash_quote = 'on';
+
+statement ok
+SET backslash_quote = 'off';
+
+statement ok
+SET backslash_quote = 'safe_encoding';
+
+statement error invalid value for parameter "backslash_quote"
+SET backslash_quote = '123';
+
+
diff --git a/pkg/sql/unsupported_vars.go b/pkg/sql/unsupported_vars.go
index 489eabc30e25..5b2cd33b7b92 100644
--- a/pkg/sql/unsupported_vars.go
+++ b/pkg/sql/unsupported_vars.go
@@ -64,7 +64,7 @@ var UnsupportedVars = func(ss ...string) map[string]struct{} {
// "application_name",
"array_nulls",
"backend_flush_after",
- "backslash_quote",
+ //"backslash_quote",
// "bytea_output",
"check_function_bodies",
// "client_encoding",
diff --git a/pkg/sql/vars.go b/pkg/sql/vars.go
index 5d3faeb3a1f3..5db82463f015 100644
--- a/pkg/sql/vars.go
+++ b/pkg/sql/vars.go
@@ -831,8 +831,11 @@ var varGen = map[string]sessionVar{
// See https://www.postgresql.org/docs/10/static/runtime-config-client.html#GUC-LOC-TIMEOUT
`lock_timeout`: makeCompatIntVar(`lock_timeout`, 0),
+ // See https://www.postgresql.org/docs/9.1/runtime-config-compatible.html
+ `backslash_quote`: makeCompatStringVar(`backslash_quote`, `safe_encoding`, `on`, `off`, `safe_encoding`),
+
// Supported for PG compatibility only.
- // See https://www.postgresql.org/docs/10/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS
+ // See https://www.postgresql.org/docs/10/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIER
`max_identifier_length`: {
Get: func(evalCtx *extendedEvalContext) string { return "128" },
},