postgresql/src/backend
Heikki Linnakangas ee937f0409 Fix data loss when restarting the bulk_write facility
If a user started a bulk write operation on a fork with existing data
to append data in bulk, the bulk_write machinery would zero out all
previously written pages up to the last page written by the new
bulk_write operation.

This is not an issue for PostgreSQL itself, because we never use the
bulk_write facility on a non-empty fork. But there are use cases where
it makes sense. TimescaleDB extension is known to do that to merge
partitions, for example.

Backpatch to v17, where the bulk_write machinery was introduced.

Author: Matthias van de Meent <boekewurm+postgres@gmail.com>
Reported-By: Erik Nordström <erik@timescale.com>
Reviewed-by: Erik Nordström <erik@timescale.com>
Discussion: https://www.postgresql.org/message-id/CACAa4VJ%2BQY4pY7M0ECq29uGkrOygikYtao1UG9yCDFosxaps9g@mail.gmail.com
2024-11-22 16:28:24 +02:00
..
access Fix outdated bit in README.tuplock 2024-11-21 16:54:36 +01:00
archive Apply more quoting to GUC names in messages 2024-09-04 13:50:44 +09:00
backup Remove unused #include's from backend .c files 2024-10-27 08:26:50 +01:00
bootstrap Assign a child slot to every postmaster child process 2024-11-14 16:12:28 +02:00
catalog Proper object locking for GRANT/REVOKE 2024-11-15 11:03:48 +01:00
commands pgindent run 2024-11-21 21:40:17 +01:00
executor Ensure cached plans are correctly marked as dependent on role. 2024-11-11 09:00:00 -06:00
foreign Improve style of two code paths 2024-10-08 10:51:20 +09:00
jit jit: Stop emitting some unnecessary instructions 2024-11-15 10:06:36 +02:00
lib Revert pg_wal_replay_wait() stored procedure 2024-11-04 22:47:57 +02:00
libpq Remove unused #include's from backend .c files 2024-10-27 08:26:50 +01:00
main Remove unused #include's from backend .c files 2024-10-27 08:26:50 +01:00
nodes Add pg_constraint rows for not-null constraints 2024-11-08 13:28:48 +01:00
optimizer Compare collations before merging UNION operations. 2024-11-19 18:26:19 -05:00
parser Add pg_constraint rows for not-null constraints 2024-11-08 13:28:48 +01:00
partitioning Revert support for ALTER TABLE ... MERGE/SPLIT PARTITION(S) commands 2024-08-24 18:48:48 +03:00
po Translation updates 2024-06-24 13:11:27 +02:00
port Require memory barrier support. 2024-07-30 23:01:55 +12:00
postmaster Pass MyPMChildSlot as an explicit argument to child process 2024-11-14 16:12:32 +02:00
regex Avoid assertion due to disconnected NFA sub-graphs in regex parsing. 2024-11-15 18:23:38 -05:00
replication Fix memory leak in pgoutput for the WAL sender 2024-11-21 15:14:02 +09:00
rewrite Ensure cached plans are correctly marked as dependent on role. 2024-11-11 09:00:00 -06:00
snowball Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
statistics Improve error message for database object stats manipulation functions. 2024-11-20 02:00:50 +09:00
storage Fix data loss when restarting the bulk_write facility 2024-11-22 16:28:24 +02:00
tcop Assign a child slot to every postmaster child process 2024-11-14 16:12:28 +02:00
tsearch Constify fields and parameters in spell.c 2024-08-06 23:04:51 +03:00
utils Add write_to_file to PgStat_KindInfo for pgstats kinds 2024-11-22 10:12:26 +09:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Blind attempt to fix LLVM dependency in the backend 2022-09-15 10:53:48 +07:00
Makefile Fix make build on MinGW 2024-06-21 08:17:23 +02:00
meson.build meson: Fix import library name in Windows 2024-06-20 09:08:36 +02:00
nls.mk Add missing gettext triggers 2024-05-14 12:57:22 +02:00