Commit 0fab8f8
Rick Owens
Format
... in order to avoid this error when trying to insert a rational
value into the database:
SqlError {seState = "22P02", seNativeError = 7, seErrorMsg = "execute: PGRES_FATAL_ERROR: ERROR: invalid input syntax for type numeric: \"603 % 10\"\n"}
Apparently, the `Show` instance isn't good enough. This implementation
technically losses some precision in some cases, but then Haskell's
`Rational` is larger than PostgreSQL's `numeric`, so that is fundamentally
unavoidable.SqlRational as a decimal ...1 parent f3923c3 commit 0fab8f8
1 file changed
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| 80 | + | |
79 | 81 | | |
80 | 82 | | |
81 | 83 | | |
82 | 84 | | |
83 | 85 | | |
84 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
85 | 93 | | |
86 | 94 | | |
87 | 95 | | |
| |||
0 commit comments