A failover is performed by executing the command ADMIN COMMAND 'hotstandby set primary alone' on the secondary server.
After all the pending transactions that are received from the primary server have been processed, the server gains the new state. No transactions are lost, and the database state reflects the state on the primary server just before the failure. However, if the safeness level used is 1-safe, some transactions might be lost in failover.