pgsql: Remove manual tracking of file position in pg_dump/pg_backup_cus

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Remove manual tracking of file position in pg_dump/pg_backup_cus
Дата
Msg-id E1jwTmW-0005Sl-H9@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
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(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: pgsql: Avoid CREATE INDEX unique index deduplication.
Следующее
От: Peter Geoghegan
Дата:
Сообщение: pgsql: Add Valgrind buffer access instrumentation.