I'm a beginner user of postgresql/postgis. I am starting to use Linux more and more but still rely on windows (on different machines). How would I setup a postgis database that I could work with under different systems? Thanks, Eelke


Basically pick a computer as a server, install the OS and database software, open the firewall for port 5432, modify the postgresql.conf and pg_hba.conf files to allow external access, and serve the data to the other computers. These are the same instructions for setting up a server on either Windows or Linux, except one OS is free. Most folks would pick Linux for the server, if you are comfortable setting up the networking and firewall rules.

All other computers (Linux/Mac/Windows/etc) connect to the PostgreSQL server the same way, using:

  • hostname, either something like server.company.org or
  • port, normally 5432 but can be some other number
  • username / password, these you set up in, e.g. pgAdmin; default superuser is postgres
| improve this answer | |

A really good guide to setup connecting to a postgres database on another machine (which could be remote) is at http://library.linode.com/databases/postgresql/pgadmin-windows. I won't repeat it here, as that guide covers it well.

The advantage of this is everything transferred between the two machines is encrypted, and you don't need to give any other IP addresses access to the main database other than localhost. If you don't need to worry about these issues, then you can just edit the postgresql.conf and pg_hba.conf as Mike Toews has said.

| improve this answer | |

Not sure if this is the correct SE site to ask on, but you need to be able to access it from both systems, so you need to put it on a common disk partition. Any windows one will do, since linux supports both the old FAT(s) and NTFS types. You'll need to mount it readable and writable for your normal user and tell postgres to look for it there (via -D or $PGDATA).

| improve this answer | |
  • 2
    I don't see how the host file system format matters to the client. I can run a linux host that runs postgres on ext4 and my windows client doesn't need to know anything about it. – Nathan W Jun 25 '12 at 0:16
  • I shouldn't have been answering so late — I misunderstood the question for pertaining to the same mixed OS machines, not a network setup. – lynxlynxlynx Jun 25 '12 at 8:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.