Shreeyansh,
Given the LSN you can get the filename which has the timeline encoded in it. (Can only get the filename on master)
> select substring(pg_walfile_name(pg_current_wal_lsn()), 1, 8); substring ----------- 00000002
Other options (works on both master/slave):
# pg_control_data | grep -i TimeLine
Or
Just use the same method on the you used on slave on the master.
psql -h "localhost" -F' ' -c 'IDENTIFY_SYSTEM' 'dbname=replication replication=true' -U postgres
Hi Shreeyansh
I have executed the below query on master. But it is giving output like below
postgres=# select pg_current_wal_lsn(); pg_current_wal_lsn -------------------- 0/4B17D198 (1 row)
In slave side it is saying timeline 6
ubuntu@platform1:~$ psql -h "localhost" -F' ' -c 'IDENTIFY_SYSTEM' 'dbname=replication replication=true' -U postgres systemid | timeline | xlogpos | dbname ---------------------+----------+------------+-------- 6567260231287314481 | 6 | 0/4B1786E0 |
How can I get the timeline from the output of the query in master?
|