Opened 17 years ago

Closed 17 years ago

Last modified 15 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:
Component: Data Provider Version: Trunk
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.

Attachments (1)

pg_namedpipes.diff (7.8 KB ) - added by warmerdam 17 years ago.
Patch demonstrating support for non-tcpip postgres connections.

Download all attachments as: .zip

Change History (5)

by warmerdam, 17 years ago

Attachment: pg_namedpipes.diff added

Patch demonstrating support for non-tcpip postgres connections.

comment:1 by warmerdam, 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.

comment:2 by jef, 17 years ago

Resolution: fixed
Status: newclosed

fixed in r7672. Please test.

comment:3 by warmerdam, 17 years ago

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


comment:4 by (none), 15 years ago

Milestone: Version 0.9.1

Milestone Version 0.9.1 deleted

Note: See TracTickets for help on using tickets.