git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 1561612) | patch
Add BufFileRead variants with short read and EOF detection
2023年1月16日 08:20:44 +0000 (09:20 +0100)
2023年1月16日 10:01:31 +0000 (11:01 +0100)
commit 20428d344a2964de6aaef9984fcd472f3c65d115
Add BufFileRead variants with short read and EOF detection

Most callers of BufFileRead() want to check whether they read the full
specified length. Checking this at every call site is very tedious.
This patch provides additional variants BufFileReadExact() and
BufFileReadMaybeEOF() that include the length checks.

I considered changing BufFileRead() itself, but this function is also
used in extensions, and so changing the behavior like this would
create a lot of problems there. The new names are analogous to the
existing LogicalTapeReadExact().

Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/f3501945-c591-8cc3-5ef0-b72a2e0eaa9c@enterprisedb.com
src/backend/access/gist/gistbuildbuffers.c diff | blob | blame | history
src/backend/backup/backup_manifest.c diff | blob | blame | history
src/backend/executor/nodeHashjoin.c diff | blob | blame | history
src/backend/replication/logical/worker.c diff | blob | blame | history
src/backend/storage/file/buffile.c diff | blob | blame | history
src/backend/utils/sort/logtape.c diff | blob | blame | history
src/backend/utils/sort/sharedtuplestore.c diff | blob | blame | history
src/backend/utils/sort/tuplestore.c diff | blob | blame | history
src/include/storage/buffile.h diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /