PostgreSQL – Share data on Network drive

database-designpostgresqlpostgresql-performance

I currently use a simple Microsoft Access database, stored on the company Network Drive, for my department's data needs. This works quite well as everybody in my team has access to the shared folder where the database is stored, and can thus query it easily at anytime.

I'm now trying to replace this Microsoft Access database by a PostgreSQL database, but I'm a bit puzzled as to how to create a similar "shared" database in PostgreSQL. I currently have a PostgreSQL server hosted at "localhost", but from what I understand; this is an instance running on my own computer which becomes unavailable as soon as I shut down my computer.

So, my question is: what is the best practice to share data with colleagues (using PosgreSQL) so everyone can connect and interact with it at any time, and so everyone always has the latest updated data?

Thanks a lot!

Best Answer

I'm a bit puzzled as to how to create a similar "shared" database in PostgreSQL.

(Sorry if this is a bit "down" on MS Access but ...)
Let's start with a fundamental Truth about [proper] databases:

Database != File 

You should think of a database as a process that runs on a machine and does work on behalf of other applications. [Largely] Forget about the fact that there are files underneath it. Treat it as a logical thing. Use database tools for database tasks (no copying database files around while the cluster is running, for example!)

To share your postgres cluster, you start the postmaster process and then connect to that running process using a Postgres-compatible client. Interactively, that's often psql.

... this is an instance running on my own computer which becomes unavailable as soon as I shut down my computer.

Correct.
You need to acquire a server machine that you can leave running all the time, on which you install and operate PostgreSQL.
This has the added benefit that you can have both your locally running instance, in which you can develop and test things and a separate Production instance, where the real thing runs and that everyone else uses (and neither can "break" the other).

Related Question