#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: | |
Component: | Data Provider | Version: | Trunk |
Keywords: | postgis connect string | Cc: | |
Must Fix for Release: | No | Platform: | Debian |
Platform Version: | Awaiting user input: | no |
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.
Attachments (1)
Change History (5)
by , 15 years ago
Attachment: | pg_namedpipes.diff added |
---|
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:
- 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.
Patch demonstrating support for non-tcpip postgres connections.