Bug report #817

PostGIS Add Layer does not support non-TCP/IP connections

Added by Frank Warmerdam - almost 17 years ago. Updated about 15 years ago.

Status:Closed
Priority:Low
Assignee:nobody -
Category:Data Provider
Affected QGIS version: Regression?:No
Operating System:Debian Easy fix?:No
Pull Request or Patch supplied: Resolution:fixed
Crashes QGIS or corrupts data: Copied to github as #:10876

Description

There is no mechanism to access a local postgres server using named pipes instead of tcp/ip sockets.

In PQconnectdb() all that is needed to support this case is to omit the host= and port= keywords in the connection string.

Likewise it would be helpful (at least for this case) to be able to omit the userid and password.

pg_namedpipes.diff Magnifier - Patch demonstrating support for non-tcpip postgres connections. (7.77 KB) Frank Warmerdam -, 2007-11-18 07:54 PM

Associated revisions

Revision 3e0b7e43
Added by Jürgen Fischer almost 17 years ago

Improve parsing in QgsDataSourceURI (adapted from PQconnectdb) and gather
connection info parsing and creation there. Fixes #817.

Please test!

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@7672 c8812cc2-4d05-0410-92ff-de0c093fc19c

Revision 4652d5ac
Added by Jürgen Fischer almost 17 years ago

Improve parsing in QgsDataSourceURI (adapted from PQconnectdb) and gather
connection info parsing and creation there. Fixes #817.

Please test!

git-svn-id: http://svn.osgeo.org/qgis/trunk@7672 c8812cc2-4d05-0410-92ff-de0c093fc19c

History

#1 Updated by Frank Warmerdam - almost 17 years ago

I have attached a patch that at least partially implements what I want. The patch was prepared against the raster transparency branch but will hopefully apply fairly easily elsewhere. It only modifies:

M      src/app/qgsnewconnection.cpp
M      src/app/qgsdbsourceselect.cpp
M      src/core/qgsdatasourceuri.cpp

But the following files may also include logic that needs to be reviewed:

  • app/qgspgquerybuilder.cpp
  • app/qgsmapserverexport.cpp
  • plugins/geoprocessing/qgspggeoprocessing.cpp
  • plugins/spit/qgsspit.cpp
  • plugins/grass/qgsgrassmodule.cpp
  • plugins/spit/qgsconnectiondialog.cpp
  • plugins/spit/qgsspit.cpp

The logic is that if host is empty then host= and port= should not be included to support named pipe connections. And if user is "" then user= and password= are omitted.

Really the connection string creation logic needs to be more centralized. Now it is done in many places and slightly different logic is used in different places.

The patch provides no clues to the user how to connect without tcpip.

#2 Updated by Jürgen Fischer almost 17 years ago

  • Resolution set to fixed
  • Status changed from Open to Closed

fixed in 4652d5ac (SVN r7673). Please test.

#3 Updated by Frank Warmerdam - almost 17 years ago

Confirmed that the patch works for my case building from trunk.

Thanks!

#4 Updated by Anonymous about 15 years ago

Milestone Version 0.9.1 deleted

Also available in: Atom PDF