@@ -330,25 +330,38 @@ ptrack_gather_filelist(List **filelist, char *path, Oid spcOid, Oid dbOid)
330330 /* Regular file inside database directory, otherwise skip it */
331331 if (dbOid != InvalidOid || spcOid == GLOBALTABLESPACE_OID )
332332 {
333+ #if PG_VERSION_NUM >= 170000
334+ RelFileNumber relNumber ;
335+ unsigned segno ;
336+ #else
333337 int oidchars ;
334338 char oidbuf [OIDCHARS + 1 ];
339+ #endif
335340 char * segpath ;
336341 PtrackFileList_i * pfl = palloc0 (sizeof (PtrackFileList_i ));
337342
338343 /*
339344 * Check that filename seems to be a regular relation file.
340345 */
346+ #if PG_VERSION_NUM >= 170000
347+ if (!parse_filename_for_nontemp_relation (de -> d_name , & relNumber , & pfl -> forknum , & segno ))
348+ continue ;
349+ #else
341350 if (!parse_filename_for_nontemp_relation (de -> d_name , & oidchars , & pfl -> forknum ))
342351 continue ;
343-
352+ #endif
344353 /* Parse segno */
345354 segpath = strstr (de -> d_name , "." );
346355 pfl -> segno = segpath != NULL ? atoi (segpath + 1 ) : 0 ;
347356
348357 /* Fill the pfl in */
358+ #if PG_VERSION_NUM >= 170000
359+ nodeRel (pfl -> relnode ) = relNumber ;
360+ #else
349361 memcpy (oidbuf , de -> d_name , oidchars );
350362 oidbuf [oidchars ] = '\0' ;
351363 nodeRel (pfl -> relnode ) = atooid (oidbuf );
364+ #endif
352365 nodeDb (pfl -> relnode ) = dbOid ;
353366 nodeSpc (pfl -> relnode ) = spcOid == InvalidOid ? DEFAULTTABLESPACE_OID : spcOid ;
354367 pfl -> path = GetRelationPath (dbOid , nodeSpc (pfl -> relnode ),
0 commit comments