forked from haskellari/postgresql-simple
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Parenthesize negative numbers in
ToField
instances.
This is necessary because in PostgreSQL, `-` is a unary operator that has lower precedence than the `::` operator, and that can cause problems at the edge of allowed ranges. For example, `-32768::int2` is parsed as `-(32768::int2)`, which throws an "out of range" error, even though `(-32768)::int2` is accepted. Closes haskellari#143.
- Loading branch information
1 parent
f9a3779
commit d7477c1
Showing
1 changed file
with
37 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters