PostgreSQL - WAL segment file creation and naming conventions
According to the source code (assuming I'm looking at the correct location, Postgres will take an old WAL file and rename it based on the current timeline ID.  According to this comment, timeline ID of old files are ignored -- basically, the assumption is that if you have files with LSN &lt; current LSN, it doesn't matter if it's from another timeline: it's just "old" and can be recycled