0

I just got a new mac and am getting everything installed on it (postgres, postgis, qgis, grass, gdal, brew, ruby, etc) and am about to install QGis.

QGis is a great tool for me, except for that with my other mac I was never able to get it to connect to PostgreSQL.

PGAdmin always worked when connecting, but connecting QGis to the Postgres.app implementation of Postgresql never was able to connect. The error messages were depressingly vague (just recreated): Connection failed - Check settings and try again.

So my question is this. What are the ideal settings that allow qgis to connect easily to postgresql? I've found Postgres.app an easy to use implementation, but should I abandon it and use the normal brew-installed postgresql instead to get qgis to connect?

Or even better, is there a qgis/postgresql co-installation somewhere that would come close to guaranteeing inter-functionality between these two systems?

UPDATE: (after temporarily removing the Postgres.app PostgreSQL implementation) When I run this command:

brew install qgis --with-grass --with-postgis

brew starts off by installing postgresql. I'm going with this for now and am hoping the "pipes" between QGis & PostgreSQL will be setup to communicate with one another...

asked Oct 8, 2013 at 18:34
2
  • In my experience, QGIS won't connect to a database without a username and password. Some PostGIS installations will create a database that does not require a password. Those cannot be used in QGIS without first adding a password. Commented Oct 8, 2013 at 18:56
  • On my other mac I'm attempting to login with a username & password and am getting the same useless "Connection failed - Check settings and try again." Commented Oct 8, 2013 at 19:42

3 Answers 3

2

If I understand, you have used Homebrew to install all, why ?

Compatibility

It is much easier to use the solutions of KyngChaos that ensure the compatibility.

These solutions use the standard Apple Python (no need of Homebrew)

And yes, it is possible to install all with Homebrew or MacPorts, but it is more difficult if you don't know the UNIX part of Mac OS X.

PostgreSQL/PostGIS

To connect to a PostgreSQL service, you need a host, a Port, the name of a database, a user and the password of the user. Traditionally the host is "localhost" and the Port = 5432 (same procedure for QGIS, PgAdminIII or others PostgreSQL clients) but others installations of PostgreSQL use other ports.

Connection failed - Check settings and try again.

So, what is the host and the Port of your PostgreSQL installation ? I've never had any problems with the connection QGIS/PostgreSQL, whatever the installed version installed

answered Oct 8, 2013 at 19:37
3
  • I've switched to the KyngChaos version and am still getting the same results. Currently trying to require postgresql to require a password but am running into a lot of difficulty Commented Oct 9, 2013 at 14:17
  • I think that you need to understand how PostgreSQL works. If you can use PgAdminIII, it is the same with QGIS Commented Oct 9, 2013 at 18:20
  • No its not. Maybe theoretically it is, but in practice that is simply not the case. Forcing postgresql to require a password (not the default these days) requires me to edit pg_hba.conf, which I have done, to no effect (i.e. psql still not requiring password) Commented Oct 9, 2013 at 20:17
1

I think the true goal of this question (mine) was to use qgis in conjunction with a database. So my solution here, having not been able to get PostgreSQL to work for me here, is to simply convert my PostgreSQL PostGIS database into a spatialite database, and load that into QGIS.

There will be some performance issues with spatialite, but given PostgreSQL and no other SQL database working for me with QGis? spatialite will be just fine.

answered Mar 1, 2014 at 5:28
-1

last time i have same problem :

what i have done to solve that is refer on this link http://hub.qgis.org/issues/735 i hope can solve your problem to.

the problem is because postgres still limit connection. if you have add configuration for truth the localhost for connection to database everything running smooth.

Other thing you must consider after have connection is to activate the PostGIS extension. Happy Mapping.

answered Feb 5, 2015 at 8:53
2
  • This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. You can also add a bounty to draw more attention to this question once you have enough reputation. Commented Feb 5, 2015 at 11:22
  • i have write my step on other thread. gis.stackexchange.com/a/133191/45763 Commented Feb 5, 2015 at 11:44

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.