Skip to content

Commit 6817467

Browse files
doc: Document error handling in PGTYPESnumeric_to_long
The documentation for PGTYPESnumeric_to_long only mentioned errno being set to indicate overflow but the code also sets errno when underflow happens. Reported-by: Aidar Imamov <a.imamov@postgrespro.ru> Discussion: https://postgr.es/m/eebf0ad50ad4321d65d2d64dd6b7f17d@postgrespro.ru
1 parent b2d6b4c commit 6817467

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

doc/src/sgml/ecpg.sgml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2390,9 +2390,10 @@ int PGTYPESnumeric_to_long(numeric *nv, long *lp);
23902390
The function converts the numeric value from the variable that
23912391
<literal>nv</literal> points to into the long integer variable that
23922392
<literal>lp</literal> points to. It returns 0 on success and -1 if an error
2393-
occurs, including overflow. On overflow, the global variable
2393+
occurs, including overflow and underflow. On overflow, the global variable
23942394
<literal>errno</literal> will be set to <literal>PGTYPES_NUM_OVERFLOW</literal>
2395-
additionally.
2395+
and on underflow <literal>errno</literal> will be set to
2396+
<literal>PGTYPES_NUM_UNDERFLOW</literal>.
23962397
</para>
23972398
</listitem>
23982399
</varlistentry>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy