Previously we called strtol() with base 0, so that a leading zero digit caused the number to be read as octal. This is not documented because it was not the original intent: before commit7ccb6dc2d, this code used atoi() which would have read the number as decimal always. Use base 10 instead to restore the original behavior. Also reject a bare minus sign consistently. Per POSIX, strtol() "may" set errno for that case but doesn't have to, and if it doesn't then we'd not have noticed the bad syntax but read the value as 0. Although this change restores old behavior,7ccb6dc2dwas a long time ago, so it's at least possible that someone out there is expecting the octal behavior. So it doesn't seem like a great idea to put this into stable branches. But I (tgl) judge it not too late for v19. Author: Marko Grujic <marko.grujic@enterprisedb.com> Reviewed-by: Manu <manuelreyesbravo@gmail.com> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CAOvwyF3=brZoxwcwHRQqvLjuqSqxiTN7RXpKMNHXJ1WAS5GQ2Q@mail.gmail.com Backpatch-through: 19
PostgreSQL Database Management System
This directory contains the source code distribution of the PostgreSQL database management system.
PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions. This distribution also contains C language bindings.
Copyright and license information can be found in the file COPYRIGHT.
General documentation about this version of PostgreSQL can be found at https://www.postgresql.org/docs/19/. In particular, information about building PostgreSQL from the source code can be found at https://www.postgresql.org/docs/19/installation.html.
The latest version of this software, and related software, may be obtained at https://www.postgresql.org/download/. For more information look at our web site located at https://www.postgresql.org/.