Re: Wal file query
От | Atul Kumar |
---|---|
Тема | Re: Wal file query |
Дата | |
Msg-id | CA+ONtZ6psqRG5Rdfwbp7wgJ9fyo4VHx1CPmR941HtWxrz4tc2g@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Wal file query (Kashif Zeeshan <kashi.zeeshan@gmail.com>) |
Ответы |
Re: Wal file query
|
Список | pgsql-general |
I got the error:
Wal control functions cannot be executed during recovery.
I need the solution that should in when streaming replication is configured.
My postgres version is 13.20
Regards.
On Tue, 8 Apr 2025, 17:32 Kashif Zeeshan, <kashi.zeeshan@gmail.com> wrote:
Hi AtulStart by looking at the current WAL LSN and insert LSN. Thepg_current_wal_lsn
is the location of the last write. Thepg_current_wal_insert_lsn
is the logical location and reflects data in the buffer that has not been written to disk. There is also a flush value that shows what has been written to durable storage.[postgres] # select pg_current_wal_lsn(), pg_current_wal_insert_lsn(); pg_current_wal_lsn | pg_current_wal_insert_lsn --------------------+--------------------------- 76/7D000000 | 76/7D000028 (1 row)
Although you can guess the name of the WAL file based on the above output, it is best to use the
pg_walfile_name
function.
[postgres] # select pg_walfile_name('76/7D000028'); pg_walfile_name -------------------------- 00000001000000760000007D (1 row)
For details visit following link : https://www.crunchydata.com/blog/postgres-wal-files-and-sequuence-numbers
Thanks
Kashif Zeeshan
On Tue, Apr 8, 2025 at 4:44 PM Atul Kumar <akumar14871@gmail.com> wrote:In streaming replication What is the way to check which "WAL file" is currently in use in primary and in standby ?Regards.
В списке pgsql-general по дате отправления: