pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Remove manual tracking of file position in pg_dump/pg_backup_cus 3+ messages / 1 participants [nested] [flat]
* pgsql: Remove manual tracking of file position in pg_dump/pg_backup_cus @ 2020-07-17 17:04 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2020-07-17 17:04 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Remove manual tracking of file position in pg_dump/pg_backup_custom.c. We do not really need to track the file position by hand. We were already relying on ftello() whenever the archive file is seekable, while if it's not seekable we don't need the file position info anyway because we're not going to be able to re-write the TOC. Moreover, that tracking was buggy since it failed to account for the effects of fseeko(). Somewhat remarkably, that seems not to have made for any live bugs up to now. We could fix the oversights, but it seems better to just get rid of the whole error-prone mess. In itself this is merely code cleanup. However, it's necessary infrastructure for an upcoming bug-fix patch (because that code *does* need valid file position after fseeko). The bug fix needs to go back as far as v12; hence, back-patch that far. Discussion: https://postgr.es/m/CALBH9DDuJ+scZc4MEvw5uO-=vRyR2=QF9+Yh=3hPEnKHWfS81A@mail.gmail.com Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/447cf2f8e9dcf9fd89c935f2daee13326a91630a Modified Files -------------- src/bin/pg_dump/pg_backup_custom.c | 53 ++++++++++---------------------------- 1 file changed, 14 insertions(+), 39 deletions(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Remove manual tracking of file position in pg_dump/pg_backup_cus @ 2020-07-17 17:04 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2020-07-17 17:04 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Remove manual tracking of file position in pg_dump/pg_backup_custom.c. We do not really need to track the file position by hand. We were already relying on ftello() whenever the archive file is seekable, while if it's not seekable we don't need the file position info anyway because we're not going to be able to re-write the TOC. Moreover, that tracking was buggy since it failed to account for the effects of fseeko(). Somewhat remarkably, that seems not to have made for any live bugs up to now. We could fix the oversights, but it seems better to just get rid of the whole error-prone mess. In itself this is merely code cleanup. However, it's necessary infrastructure for an upcoming bug-fix patch (because that code *does* need valid file position after fseeko). The bug fix needs to go back as far as v12; hence, back-patch that far. Discussion: https://postgr.es/m/CALBH9DDuJ+scZc4MEvw5uO-=vRyR2=QF9+Yh=3hPEnKHWfS81A@mail.gmail.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/a8d0732ac2b5527ce47cce5b325f8df93f4d19cc Modified Files -------------- src/bin/pg_dump/pg_backup_custom.c | 53 ++++++++++---------------------------- 1 file changed, 14 insertions(+), 39 deletions(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Remove manual tracking of file position in pg_dump/pg_backup_cus @ 2020-07-17 17:04 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2020-07-17 17:04 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Remove manual tracking of file position in pg_dump/pg_backup_custom.c. We do not really need to track the file position by hand. We were already relying on ftello() whenever the archive file is seekable, while if it's not seekable we don't need the file position info anyway because we're not going to be able to re-write the TOC. Moreover, that tracking was buggy since it failed to account for the effects of fseeko(). Somewhat remarkably, that seems not to have made for any live bugs up to now. We could fix the oversights, but it seems better to just get rid of the whole error-prone mess. In itself this is merely code cleanup. However, it's necessary infrastructure for an upcoming bug-fix patch (because that code *does* need valid file position after fseeko). The bug fix needs to go back as far as v12; hence, back-patch that far. Discussion: https://postgr.es/m/CALBH9DDuJ+scZc4MEvw5uO-=vRyR2=QF9+Yh=3hPEnKHWfS81A@mail.gmail.com Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/39a068ce66758c2c2138754e75bebc2f59160edc Modified Files -------------- src/bin/pg_dump/pg_backup_custom.c | 57 ++++++++++---------------------------- 1 file changed, 14 insertions(+), 43 deletions(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2020-07-17 17:04 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2020-07-17 17:04 pgsql: Remove manual tracking of file position in pg_dump/pg_backup_cus Tom Lane <tgl@sss.pgh.pa.us> 2020-07-17 17:04 pgsql: Remove manual tracking of file position in pg_dump/pg_backup_cus Tom Lane <tgl@sss.pgh.pa.us> 2020-07-17 17:04 pgsql: Remove manual tracking of file position in pg_dump/pg_backup_cus Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox