Re: pg_basebackup fails on databases with high OIDs
Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Magnus Hagander <magnus@hagander.net>, Julien Rouhaud <rjuju123@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2020-01-11T07:21:11Z
Lists: pgsql-hackers
Attachments
- v2-0001-Fix-base-backup-with-database-OIDs-larger-than-IN.patch (text/plain) patch v2-0001
On 2020-01-06 21:00, Magnus Hagander wrote: >> +0.5 to avoid calling OidInputFunctionCall() > > Or just directly using atol() instead of atoi()? Well maybe not > directly but in a small wrapper that verifies it's not bigger than an > unsigned? > > Unlike in cases where we use oidin etc, we are dealing with data that > is "mostly trusted" here, aren't we? Meaning we could call atol() on > it, and throw an error if it overflows, and be done with it? > Subdirectories in the data directory aren't exactly "untrusted enduser > data"... Yeah, it looks like we are using strtoul() without additional error checking in similar situations, so here is a patch doing it like that. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
Fix base backup with database OIDs larger than INT32_MAX
- 259bbe177808 13.0 landed
- bf65f3c8871b 12.2 landed
-
Track block level checksum failures in pg_stat_database
- 6b9e875f7286 12.0 cited