Hello database experts!

Here is my problem, I have an application that uses a postgresql database to store data. The application is going to be used on a Tablet and on a Desktop. Important: An Internet Connection won't be available all the time, so using an always online solution is not going to work.

Use case scenarios:

1. Tablet leaves the office and adds some new records, when it returns to the office I sync the Tablet database with the Desktop database without problems. I use the Tablet db as master and the Desktop db as slave.

2. Tablet leaves the office, Desktop adds some new records, when the Tablet returns to the office I sync them again. I use the Desktop db as master and the Tablet db as slave, once again no problems with syncing.

3. Tablet leaves the office and makes some new records. While the Tablet is away, the Desktop also adds some new records. Tablet returns to the office, is it possible to sync the databases in this case? Because from what I understand, when you use replication you need to select a Master and a Slave database and make one look exactly like the other. Is there any option for me?

The application was created in MS Access 2013 initially. I decided to move the backend to a Postgres database to take advantage of replication, linking the Access forms to the Postgres tables. It works fine on most cases, except for the example 3 above.

Thank you in advance for any help!