0

I've created simple PostgreSQL database on my localhost and connected it to my project. I want to pass the project to someone else and share the same database. Also i want my db to run 24h per day and be accessible without previous switching on.

Justyna
  • 11
  • 2

1 Answers1

0

Let's see. It is a lot of spec. Fortunately, the solution for your problem is simple: move your database from local machine (your PC/laptop) to a network-connected server. Below is step-by-step list of what you need to do:

  1. Find a decent PostgreSQL DB provider (some paid, some free), for example: Amazon RDS , ElephantSQL, Azure PostgreSQL. Then create an instance. Or you can setup a server and install PostgreSQL. Either works fine.
  2. Change the connection from localhost:5432 to new server. There is no detail on question, so I'll provide an example of connection string: postgres://{remoteuser}:{password}@{remotehost}:{port}/{dbname}
  3. If your local database already contain data, copy it to new database
pg_dump -C -h localhost -U localuser dbname | psql -h remotehost -U remoteuser dbname
yogski
  • 181
  • 1
  • 10