diff --git a/src/db_postgres.nim b/src/db_postgres.nim index cb9e5414ac..4edeac2fcb 100644 --- a/src/db_postgres.nim +++ b/src/db_postgres.nim @@ -110,7 +110,9 @@ proc dbQuote*(s: string): string = ## DB quotes the string. result = "'" for c in items(s): - if c == '\'': add(result, "''") + case c + of '\'': add(result, "''") + of '\0': add(result, "\\0") else: add(result, c) add(result, '\'')