@@ -330,25 +330,38 @@ ptrack_gather_filelist(List **filelist, char *path, Oid spcOid, Oid dbOid)
330
330
/* Regular file inside database directory, otherwise skip it */
331
331
if (dbOid != InvalidOid || spcOid == GLOBALTABLESPACE_OID )
332
332
{
333
+ #if PG_VERSION_NUM >= 170000
334
+ RelFileNumber relNumber ;
335
+ unsigned segno ;
336
+ #else
333
337
int oidchars ;
334
338
char oidbuf [OIDCHARS + 1 ];
339
+ #endif
335
340
char * segpath ;
336
341
PtrackFileList_i * pfl = palloc0 (sizeof (PtrackFileList_i ));
337
342
338
343
/*
339
344
* Check that filename seems to be a regular relation file.
340
345
*/
346
+ #if PG_VERSION_NUM >= 170000
347
+ if (!parse_filename_for_nontemp_relation (de -> d_name , & relNumber , & pfl -> forknum , & segno ))
348
+ continue ;
349
+ #else
341
350
if (!parse_filename_for_nontemp_relation (de -> d_name , & oidchars , & pfl -> forknum ))
342
351
continue ;
343
-
352
+ #endif
344
353
/* Parse segno */
345
354
segpath = strstr (de -> d_name , "." );
346
355
pfl -> segno = segpath != NULL ? atoi (segpath + 1 ) : 0 ;
347
356
348
357
/* Fill the pfl in */
358
+ #if PG_VERSION_NUM >= 170000
359
+ nodeRel (pfl -> relnode ) = relNumber ;
360
+ #else
349
361
memcpy (oidbuf , de -> d_name , oidchars );
350
362
oidbuf [oidchars ] = '\0' ;
351
363
nodeRel (pfl -> relnode ) = atooid (oidbuf );
364
+ #endif
352
365
nodeDb (pfl -> relnode ) = dbOid ;
353
366
nodeSpc (pfl -> relnode ) = spcOid == InvalidOid ? DEFAULTTABLESPACE_OID : spcOid ;
354
367
pfl -> path = GetRelationPath (dbOid , nodeSpc (pfl -> relnode ),
0 commit comments