Feature request #2040

Connecting to PostgreSQL via OGR could use default username

Added by grasslandtom - over 14 years ago. Updated almost 14 years ago.

Assignee:nobody -
Category:Data Provider
Pull Request or Patch supplied: Resolution:fixed
Easy fix?:No Copied to github as #:12100


Adding a PostGIS-layer via the "Add PostGIS Layer"-button does not require entering a username for the connection. This is different for a connection via the button "Add Vector Layer", where not entering an explicit username raises an error.
Maybe the behaviour of "Add PostGIS Layer" could be adopted to "Add Vector Layer" when connecting to a PostgreSQL database.


#1 Updated by Jürgen Fischer over 14 years ago

AFAICS if you enter a username in the PostGIS connection it's used to connect in both cases. If you don't, you are prompted for a password (but no username) in both cases - which probably is a bug in itself, but no difference.

#2 Updated by grasslandtom - over 14 years ago

To be more specific here the steps to reproduce what I meant:

Click on "Add PostGIS Layer" -> New, enter name of database to which you can connect on the console without specifying a user name (thus which accepts your Unix user name) -> Test Connect

=> this is successful in my case.

Click Cancel -> close.
Click "Add Vector Layer" -> Database -> New, select PostgreSQL, type the same database name as above -> Test Connect

=> this fails complaining about a missing PostgreSQL-user name.

Click OK, enter your Unix user name -> Test Connect

=> successful in my case

#3 Updated by grasslandtom - over 14 years ago

Can anybody confirm what is described in the previous comment?

If not I would resolve this as invalid as I am now unable to connect to PostGIS at all. The described behaviour might be part of the weird behaviour I see now.

#4 Updated by Jürgen Fischer almost 14 years ago

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

fixed in c7d632ea (SVN r12923).

Also available in: Atom PDF