diff --git a/src/Database/Persist/Schema/PostgreSQL.hs b/src/Database/Persist/Schema/PostgreSQL.hs index 17d904a..f79854c 100644 --- a/src/Database/Persist/Schema/PostgreSQL.hs +++ b/src/Database/Persist/Schema/PostgreSQL.hs @@ -36,7 +36,7 @@ quoteName = let f '\0' _ = error "quoteName found \\0 character, invalid in names" f '"' cs = '"' : '"' : cs f c cs = c : cs - in T.pack . T.foldr f [] + in T.pack . ('"' :) . T.foldr f "\"" table2sql :: TableName -> Text table2sql = quoteName . unTableName