postgres.git / summary / log / commit / refs
commit f1579ff53e1846a001f3809ee15fda2857d8efe1
Author: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date: Wed Nov 18 12:42:23 2026 +0000
Fix comments after returning paths by value
Commit ecbff4378be changed _mdfd_segpath() to return an MdPathStr by
value, but forgot to update the comment accordingly. Fix it.
Also fix the maximum-length path example in the comment introduced by
commit 37c87e63f9e, to include the fork name.
Author: Nazir Bilal Yavuz <byavuz81@gmail.com>
Discussion: https://www.postgresql.org/message-id/CAN55FZ0LsWUC3EoFLo5c6SO-AddX99k-6Me079TZOuDL579f6w@mail.gmail.com
Backpatch-through: 18
src/backend/storage/smgr/md.c | 3 +--
src/include/common/relpath.h | 4 ++--
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/backend/storage/smgr/md.c b/src/backend/storage/smgr/md.c
index db4595d4d9d..a01dfcad021 100644
--- a/src/backend/storage/smgr/md.c
+++ b/src/backend/storage/smgr/md.c
@@ -1674,8 +1674,7 @@ _fdvec_resize(SMgrRelation reln,
}
/*
- * Return the filename for the specified segment of the relation. The
- * returned string is palloc'd.
+ * Return the filename for the specified segment of the relation.
*/
static MdPathStr
_mdfd_segpath(SMgrRelation reln, ForkNumber forknum, BlockNumber segno)
diff --git a/src/include/common/relpath.h b/src/include/common/relpath.h
index 6f2fce216f8..81f097b93ce 100644
--- a/src/include/common/relpath.h
+++ b/src/include/common/relpath.h
@@ -86,10 +86,10 @@ extern int forkname_chars(const char *str, ForkNumber *fork);
/*
* The longest possible relation path lengths is from the following format:
- * sprintf(rp.path, "%s/%u/%s/%u/t%d_%u",
+ * sprintf(rp.path, "%s/%u/%s/%u/t%d_%u_%s",
* PG_TBLSPC_DIR, spcOid,
* TABLESPACE_VERSION_DIRECTORY,
- * dbOid, procNumber, relNumber);
+ * dbOid, procNumber, relNumber, forkNames[forkNumber]);
*
* Note this does *not* include the trailing null-byte, to make it easier to
* combine it with other lengths.
[parent: 4d6ff8a051a1]