Skip to content

Commit 8f5561f

Browse files
author
Sofia Kopikova
committed
PGPRO-15605 fix ptrack for PostgreSQL 18
1 parent 75838c0 commit 8f5561f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

ptrack.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,10 @@ ptrack_gather_filelist(List **filelist, char *path, Oid spcOid, Oid dbOid)
290290
{
291291
DIR *dir;
292292
struct dirent *de;
293+
#if PG_VERSION_NUM >= 180000
294+
RelPathStr str;
295+
#endif
296+
293297
dir = AllocateDir(path);
294298

295299
while ((de = ReadDirExtended(dir, path, LOG)) != NULL)
@@ -364,8 +368,14 @@ ptrack_gather_filelist(List **filelist, char *path, Oid spcOid, Oid dbOid)
364368
#endif
365369
nodeDb(pfl->relnode) = dbOid;
366370
nodeSpc(pfl->relnode) = spcOid == InvalidOid ? DEFAULTTABLESPACE_OID : spcOid;
371+
#if PG_VERSION_NUM >= 180000
372+
str = GetRelationPath(dbOid, nodeSpc(pfl->relnode),
373+
nodeRel(pfl->relnode), InvalidBackendId, pfl->forknum);
374+
pfl->path = pstrdup(str.str);
375+
#else
367376
pfl->path = GetRelationPath(dbOid, nodeSpc(pfl->relnode),
368377
nodeRel(pfl->relnode), InvalidBackendId, pfl->forknum);
378+
#endif
369379

370380
*filelist = lappend(*filelist, pfl);
371381

0 commit comments

Comments
 (0)