fix(spectypes): correct quoting logic in formatPostgresStringArray

This commit is contained in:
Hein
2026-04-30 15:38:21 +02:00
parent cc9c4337fd
commit 7014b97d56

View File

@@ -66,7 +66,7 @@ func formatPostgresStringArray(vals []string) string {
parts := make([]string, len(vals))
for i, v := range vals {
// Quote if value contains comma, double-quote, backslash, braces, whitespace, or is empty.
needsQuote := v == "" || strings.ContainsAny(v, `,"\\{}` + "\t\n\r ")
needsQuote := v == "" || strings.ContainsAny(v, `,"\\{}`+"\t\n\r ")
if needsQuote {
v = strings.ReplaceAll(v, `\`, `\\`)
v = strings.ReplaceAll(v, `"`, `""`)