We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 48aee7e commit f7d3d64Copy full SHA for f7d3d64
1 file changed
src/Database/PostgreSQL/PQTypes/Model/Index.hs
@@ -65,6 +65,16 @@ instance Ord IndexColumn where
65
instance IsString IndexColumn where
66
fromString s = IndexColumn (fromString s) Nothing
67
68
+-- | Build an 'IndexColumn' from a column name.
69
+--
70
+-- If the column name is a non-reserved keyword in PostgreSQL it must be given
71
+-- double-quoted, e.g.
72
73
+-- @timestamp@ -> @\"\\\"timestamp\\\"\"@
74
75
+-- PostgreSQL stores the index definition with the keyword quoted, so the column
76
+-- name passed here has to match that exactly or the database consistency check
77
+-- will report a mismatch.
78
indexColumn :: RawSQL () -> IndexColumn
79
indexColumn col = IndexColumn col Nothing
80
0 commit comments