Opened 15 years ago
Closed 15 years ago
Last modified 14 years ago
#817 closed defect (fixed)
PostGIS Add Layer does not support non-TCP/IP connections
|Reported by:||warmerdam||Owned by:||nobody|
|Priority:||major: does not work as expected||Milestone:|
|Keywords:||postgis connect string||Cc:|
|Must Fix for Release:||No||Platform:||Debian|
|Platform Version:||Awaiting user input:||no|
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.
Change History (5)
by , 15 years ago
comment:1 by , 15 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.
comment:2 by , 15 years ago
|Status:||new → closed|
fixed in r7672. Please test.
comment:3 by , 15 years ago
Confirmed that the patch works for my case building from trunk.
comment:4 by , 14 years ago
Milestone Version 0.9.1 deleted
Patch demonstrating support for non-tcpip postgres connections.