File tree 1 file changed +6
-1
lines changed
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.
126
126
| ``interval `` | :class: `datetime.timedelta \ |
127
127
| | <python:datetime.timedelta>` |
128
128
+----------------------+-----------------------------------------------------+
129
- | ``float ``, | :class: `float <python:float> ` |
129
+ | ``float ``, | :class: `float <python:float> ` [ #f1 ]_ |
130
130
| ``double precision `` | |
131
131
+----------------------+-----------------------------------------------------+
132
132
| ``smallint ``, | :class: `int <python:int> ` |
@@ -157,6 +157,11 @@ The table below shows the correspondence between PostgreSQL and Python types.
157
157
158
158
All other types are encoded and decoded as text by default.
159
159
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.
160
165
161
166
.. _asyncpg-custom-codecs :
162
167
You can’t perform that action at this time.
0 commit comments