Bug report #817
PostGIS Add Layer does not support non-TCP/IP connections
|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|
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.
#1 Updated by Frank Warmerdam - about 13 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:
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.