On Tue, Dec 14, 2021 at 9:55 AM Marc Millas <marc.millas@xxxxxxxxxx> wrote: > > Hi, > postgres 13 question, > > if I setup pg_receivewal from a primary instance to a given directory, and then setup a standby with a restore_command pointing to that directory,, the changes on the primary are applied on the standby at each wal change. And this, even if I run pg_receivewal with the --synchronous option. > > My question: as the synchronous option is supposed to make pg_receivewal write transaction immediately in the wal files, is there a way to ask the standby to apply them on the fly ie. without waiting a wal file change ? I don't think that can be done, actually, the wal_receiver process is running in the same cluster so we can interact with that process and know exactly up to what LSN it has flush and what wal data is valid to be applied and wal receiver also continues to append more WAL to the same file. But pg_receivewal is a separate utility so this can serve as an archive location that means we can restore the complete WAL file only. -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com