diff options
| author | Álvaro Herrera <alvherre@kurilemu.de> | 2025-11-06 20:33:57 +0100 |
|---|---|---|
| committer | Álvaro Herrera <alvherre@kurilemu.de> | 2025-11-06 20:33:57 +0100 |
| commit | a2b02293bc65dbb2401cb19c724f52c6ee0f2faf (patch) | |
| tree | f982dafa5b106905027b0e11fe9cdee9fc0bab6f /contrib/pg_walinspect/pg_walinspect.c | |
| parent | 06edbed478625829b19c35d0c17d805be588afa6 (diff) | |
Use XLogRecPtrIsValid() in various places
Now that commit 06edbed47862 has introduced XLogRecPtrIsValid(), we can
use that instead of:
- XLogRecPtrIsInvalid()
- direct comparisons with InvalidXLogRecPtr
- direct comparisons with literal 0
This makes the code more consistent.
Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Discussion: https://postgr.es/m/aQB7EvGqrbZXrMlg@ip-10-97-1-34.eu-west-3.compute.internal
Diffstat (limited to 'contrib/pg_walinspect/pg_walinspect.c')
| -rw-r--r-- | contrib/pg_walinspect/pg_walinspect.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/pg_walinspect/pg_walinspect.c b/contrib/pg_walinspect/pg_walinspect.c index 501cea8fc1a..3c5e4a856a7 100644 --- a/contrib/pg_walinspect/pg_walinspect.c +++ b/contrib/pg_walinspect/pg_walinspect.c @@ -83,7 +83,7 @@ GetCurrentLSN(void) else curr_lsn = GetXLogReplayRecPtr(NULL); - Assert(!XLogRecPtrIsInvalid(curr_lsn)); + Assert(XLogRecPtrIsValid(curr_lsn)); return curr_lsn; } @@ -127,7 +127,7 @@ InitXLogReaderState(XLogRecPtr lsn) /* first find a valid recptr to start from */ first_valid_record = XLogFindNextRecord(xlogreader, lsn); - if (XLogRecPtrIsInvalid(first_valid_record)) + if (!XLogRecPtrIsValid(first_valid_record)) ereport(ERROR, errmsg("could not find a valid record after %X/%08X", LSN_FORMAT_ARGS(lsn))); |
