multiple archive_command in PostgreSQL
You don't need multiple archive_commands:

archive_command = 'cp %p /.../%f &amp;&amp; (command to archive to S3)'


The &amp;&amp; is interpreted by the shell. If the cp has a non-zero return code, that will be the result of archive_command. If the result is 0 (success), the second command is executed, and its return code will be the result of archive_command.

You can also defer archiving to S3 to the standby server, but then you have to set archive_mode = always there. The disadvantage is that the configuration on primary and standby will be different, which makes failover more complicated. Does the command to archive a file to S3 really cause a substantial performance impact?