mirror of
https://github.com/postgres/postgres.git
synced 2025-11-09 06:21:09 +03:00
Clean up some residual confusion between OIDs and RelFileNumbers.
Commit b0a55e4329 missed a few places
where we are referring to the number used as a part of the relation
filename as an "OID". We now want to call that a "RelFileNumber".
Some of these places actually made it sound like the OID in question
is pg_class.oid rather than pg_class.relfilenode, which is especially
good to clean up.
Dilip Kumar with some editing by me.
This commit is contained in:
@@ -1172,7 +1172,8 @@ sendDir(bbsink *sink, const char *path, int basepathlen, bool sizeonly,
|
||||
int excludeIdx;
|
||||
bool excludeFound;
|
||||
ForkNumber relForkNum; /* Type of fork if file is a relation */
|
||||
int relOidChars; /* Chars in filename that are the rel oid */
|
||||
int relnumchars; /* Chars in filename that are the
|
||||
* relnumber */
|
||||
|
||||
/* Skip special stuff */
|
||||
if (strcmp(de->d_name, ".") == 0 || strcmp(de->d_name, "..") == 0)
|
||||
@@ -1222,23 +1223,24 @@ sendDir(bbsink *sink, const char *path, int basepathlen, bool sizeonly,
|
||||
|
||||
/* Exclude all forks for unlogged tables except the init fork */
|
||||
if (isDbDir &&
|
||||
parse_filename_for_nontemp_relation(de->d_name, &relOidChars,
|
||||
parse_filename_for_nontemp_relation(de->d_name, &relnumchars,
|
||||
&relForkNum))
|
||||
{
|
||||
/* Never exclude init forks */
|
||||
if (relForkNum != INIT_FORKNUM)
|
||||
{
|
||||
char initForkFile[MAXPGPATH];
|
||||
char relOid[OIDCHARS + 1];
|
||||
char relNumber[OIDCHARS + 1];
|
||||
|
||||
/*
|
||||
* If any other type of fork, check if there is an init fork
|
||||
* with the same OID. If so, the file can be excluded.
|
||||
* with the same RelFileNumber. If so, the file can be
|
||||
* excluded.
|
||||
*/
|
||||
memcpy(relOid, de->d_name, relOidChars);
|
||||
relOid[relOidChars] = '\0';
|
||||
memcpy(relNumber, de->d_name, relnumchars);
|
||||
relNumber[relnumchars] = '\0';
|
||||
snprintf(initForkFile, sizeof(initForkFile), "%s/%s_init",
|
||||
path, relOid);
|
||||
path, relNumber);
|
||||
|
||||
if (lstat(initForkFile, &statbuf) == 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user