We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e9fbf64 commit 8754167Copy full SHA for 8754167
core/src/plugins/postgres/db.go
@@ -29,8 +29,9 @@ func escapeConnectionParam(x string) string {
29
// PostgreSQL libpq connection string escaping rules:
30
// 1. Single quotes must be doubled: ' -> ''
31
// 2. Backslashes must be doubled: \ -> \\
32
- x = strings.ReplaceAll(x, "\\", "\\\\")
+ // IMPORTANT: Escape single quotes first, then backslashes to avoid double-escaping
33
x = strings.ReplaceAll(x, "'", "''")
34
+ x = strings.ReplaceAll(x, "\\", "\\\\")
35
return x
36
}
37
0 commit comments