0

Id like to import osm into my postgis to use it with qgis. I followed exactly these instructions: http://wiki.openstreetmap.org/wiki/PostGIS/Installation

At step #Activate_PostGIS:

psql --username=gisuser --dbname=gis --command="\d"

This error occured:

psql: FATAL:  Peer authentication failed for user "gisuser"

(Same after importing my *.osm by doing this:

osm2pgsql -s -U gisuser -d gis path-to-file.osm

Error:

Error: Connection to database failed: FATAL:  Peer authentication failed for user "gisuser"

I have no idea what to do, so im asking here.

Using xubuntu 12.10, postgres 9.1.11

2

I don't know how is in your pg_hba.conf but I believe you use the peer authentication method. (This method is only supported on local connections.)

Because this doesn't work, try to change it to md5 ("md5" is preferred since it sends encrypted passwords), like this:

enter image description here

and restart your database server.

References:

  • It's not always needed to restart postgresql service after modifying pg_hba.conf - it's contents are read on the fly. Next time someone tries to login to db, changes in pg_hba.conf should be applied. – SaultDon Jan 22 '14 at 19:49
  • 1
    @SaultDon - In pg_hba.conf says that This file is read on server startup and when the postmaster receives a SIGHUP signal. If you edit the file on a running system, you have to SIGHUP the postmaster for the changes to take effect. You can use "pg_ctl reload" to do that. Also on Wikipedia says that The SIGHUP signal is sent to a process when its controlling terminal is closed. – Sorin Călinică Jan 22 '14 at 20:00
  • @SorinCălinică Neat. On a windows and linux PC, I've noticed these changes take effect immediately. But if it recommends to restart, then sure. – SaultDon Jan 22 '14 at 20:02
  • @SaultDon - I think, also, that your observation it is very important to know, mainly for a production server. – Sorin Călinică Jan 22 '14 at 20:06
  • @SorinCălinică Could it be a bug? I can ask maybe on the IRC. – SaultDon Jan 22 '14 at 20:23

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.