summary refs log tree commit diff stats
path: root/lib/impure/db_postgres.nim
diff options
context:
space:
mode:
Diffstat (limited to 'lib/impure/db_postgres.nim')
-rw-r--r--lib/impure/db_postgres.nim4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/impure/db_postgres.nim b/lib/impure/db_postgres.nim
index cb9e5414a..4edeac2fc 100644
--- a/lib/impure/db_postgres.nim
+++ b/lib/impure/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, '\'')