Sync offline PostgreSQL server I am new to PostgreSQL. I am looking for a solution wherein 2 mirror images of a database sit on a local and remote server. All the work is done on the local server and at periodically synced with the remote server. Is there any solution for this issue.

I am using Debian.
One-way read-only replica

If one is a read-only replica and the other one is the master, you can and should use WAL archive shipping for this. The master generates WAL and stores it somewhere accessible to both servers. Some like to use WAL-E to store it in S3, but you can just as easily have the replica scp it from the master on demand or whatever.

The replica, whenever it is online, fetches WAL and replays it to catch up with the master. It can also remove WAL from the archive after successful replay if there's only one replica. (Otherwise deciding when to remove WAL is ... hard).

The replica can run read-only queries, but nothing read/write.

Two-way read/write

If you want two-way disconnected sync, then I suggest you start with the chapter in database theory named "El Dorado", then continue reading into "Magic". Everybody wants this, and it does exist, but always with some difficult compromises. The biggest: how do you deal with conflicts where both modify the same record? How do you handle read-modify-write cycle inconsistencies when disconnected?

You need a database plugin that has application specific merge logic, or to write your application very carefully so it can survive last-update-wins merge logic. If you're doing that, and really keen to try very experimental code, keep an eye on http://wiki.postgresql.org/wiki/BDR_User_Guide, an in-development two-way logical replicaiton feature for PostgreSQL. Otherwise, you may have some success with Slony-I or Bucardo, external replication tools for Pg.

If at all possible, design you app not to require this, or have your app deal with the synchronization at a higher level using application specific logic, where you record changes (with triggers or with app logicl) and then replay them using your application's knowledge of what the data means.