pg_tm_aux icon indicating copy to clipboard operation
pg_tm_aux copied to clipboard

build failed for postgresql-15.3

Open genezhang opened this issue 2 years ago • 3 comments

I didn't try 15.1 or 15.2, but it was failing for 15.3:

pg_tm_aux.c:48:49: error: ‘ThisTimeLineID’ undeclared (first use in this function); did you mean ‘TimeLineID’?
   48 |  List    *timelineHistory = readTimeLineHistory(ThisTimeLineID);

For 14.x, ThisTimeLineID could be found in access/xlog.h:extern PGDLLIMPORT TimeLineID ThisTimeLineID; /* current TLI */ It is no longer in 15.3 access/xlog.h.

Since I'm not familiar with the PG code, couldn't resolve it. Would appreciate it much if this could be made to work with PG 15. Thanks.

genezhang avatar May 21 '23 03:05 genezhang

Just found out that in 15, GetWALInsertionTimeLine() replaces the global ThisTimeLineID, as I guess this name is also used as a field in structures. FYI. So I added the following lines before using ThisTimeLineID in pg_tm_aux:

#if (PG_VERSION_NUM >= 150000)
        TimeLineID ThisTimeLineID = GetWALInsertionTimeLine();
#endif

Build succeeded now. Thx.

genezhang avatar May 21 '23 15:05 genezhang

Hi! Thanks for letting me know. Can you plz send a pull request?

x4m avatar May 21 '23 18:05 x4m

Thanks Andrey. https://github.com/x4m/pg_tm_aux/pull/10

genezhang avatar May 21 '23 23:05 genezhang