File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ The table below shows the correspondence between PostgreSQL and Python types.
126126| ``interval `` | :class: `datetime.timedelta \ |
127127| | <python:datetime.timedelta>` |
128128+----------------------+-----------------------------------------------------+
129- | ``float ``, | :class: `float <python:float> ` |
129+ | ``float ``, | :class: `float <python:float> ` [ #f1 ]_ |
130130| ``double precision `` | |
131131+----------------------+-----------------------------------------------------+
132132| ``smallint ``, | :class: `int <python:int> ` |
@@ -157,6 +157,11 @@ The table below shows the correspondence between PostgreSQL and Python types.
157157
158158All other types are encoded and decoded as text by default.
159159
160+ .. [#f1 ] Inexact single-precision ``float `` values may have a different
161+ representation when decoded into a Python float. This is inherent
162+ to the implementation of limited-precision floating point types.
163+ If you need the decimal representation to match, cast the expression
164+ to ``double `` or ``numeric `` in your query.
160165
161166 .. _asyncpg-custom-codecs :
162167
You can’t perform that action at this time.
0 commit comments