In relation to the functions added recently, I found an annoying problem;
pg_xlogfile_name(pg_last_xlog_receive/replay_location()) might report the
wrong name because pg_xlogfile_name() always uses the current timeline,
and a backend doesn't know the actual timeline related to the location
which pg_last_xlog_receive/replay_location() reports. Even if a backend
knows that, pg_xlogfile_name() would be unable to determine which timeline
should be used.
To solve this problem, I'm thiking to add the following functions:
* pg_current_timeline() reports the current timeline ID.
* pg_last_receive_timeline() reports the timeline ID which is related
to the last WAL receive location.
* pg_last_replay_timeline() reports the timeline ID which is related
to the last WAL replay location.
* pg_xlogfile_name(location text [, timeline bigint ]) reports the WAL
file name using the given timeline. By default, the current timeline
* pg_xlogfile_name_offset(location text [, timeline bigint]) reports
the WAL file name and offset using the given timeline. By default,
the current timeline is used.
If the second parameter is omitted, pg_xlogfile_name() would behave
as it does now. We can get the right WAL file name by giving it the
result of pg_last_receive/replay_timeline().
Thought? Or we should just drop the support of pg_xlogfile_name()
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center
pgsql-hackers by date
|Next:||From: Joachim Wieland||Date: 2010-01-19 09:58:33|
|Subject: Re: Listen / Notify - what to do when the queue is full|
|Previous:||From: Dean Rasheed||Date: 2010-01-19 09:33:30|
|Subject: Re: Fixing handling of constraint triggers|