Way to get timeline

Started by Vladimir Borodinover 10 years ago2 messagesgeneral
Jump to latest
#1Vladimir Borodin
root@simply.name

Hi all.

What is the best way to get current timeline of host? Right now I can imagine two variants:

1. Do checkpoint and read it from control file.
2. Do something like "SELECT substr(pg_xlogfile_name(pg_current_xlog_location()), 1, 8)".

Both variants seem to be a bit tricky. Is there a way better?

Thanks.

--
May the force be with you…
https://simply.name

In reply to: Vladimir Borodin (#1)
Re: [GENERAL] Way to get timeline

hi!
from master:
pg_xlogfile_name -- right!
from standby:
using replication prtotocol (example from version 92)
psql -h "$host" -F' ' -c 'IDENTIFY_SYSTEM' 'dbname=replication replication=true'

-- misha

Show quoted text

Понедельник, 20 июля 2015, 11:13 +03:00 от Vladimir Borodin <root@simply.name>:

Hi all.

What is the best way to get current timeline of host? Right now I can imagine two variants:

1. Do checkpoint and read it from control file.
2. Do something like "SELECT substr(pg_xlogfile_name(pg_current_xlog_location()), 1, 8)".

Both variants seem to be a bit tricky. Is there a way better?

Thanks.

--
May the force be with you…
https://simply.name