Bug report #1173

db grass modules

Added by Paolo Cavallini over 16 years ago. Updated over 15 years ago.

Status:Closed
Priority:Low
Assignee:leolami -
Category:GRASS
Affected QGIS version: Regression?:No
Operating System:All Easy fix?:No
Pull Request or Patch supplied: Resolution:fixed
Crashes QGIS or corrupts data: Copied to github as #:11233

Description

To connect to a pg database, the user apparently must:
- run db.connect(.schema) giving:
Driver name (pg)
Database name
"host=faunalia.it,dbname=database_name" (with comma and maybe quotes)
nameoftheschema
- run db.login giving
Database name
host=faunalia.it dbname=prova_leo (with space, no comma, no quotes)
username
password
This seems a bit more complicated than necessary. I suggest:
- to have consistent syntax
- to put each variable in a different space, separating host and db_name
- to merge the two modules into one, so user must enter Driver name,
host, dbname only once.
If you look at:
http://grass.osgeo.org/grass64/manuals/html64_user/grass-pg.html
everything looks more simple:

db.connect driver=pg database="host=myserver.itc.it,dbname=mydb"

db.login user=myname [pass=secret]

History

#1 Updated by Markus Neteler about 16 years ago

Sounds good to me.

Markus

#2 Updated by Paolo Cavallini over 15 years ago

The idea is having in the same window both connection parameters and
login credentials. The current situation is quite confusing.
Is it is possible to have two different grass commands in the same module?
Also, I do not understand why having both db.connect and db.connect.schema (the second is == to the first, with just one extra option).

#3 Updated by Markus Neteler over 15 years ago

Replying to [comment:3 pcav]:

Also, I do not understand why having both db.connect and db.connect.schema (the second is == to the first, with just one extra option).

I suggest to post this second part to the GRASS-dev list or GRASS-trac.

Markus

#4 Updated by Paolo Cavallini over 15 years ago

db.connect is a simplified version of db.connect.schema, not to bother users with an extra option, so it can stay as such. The other issues remain.

#5 Updated by Redmine Admin over 15 years ago

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

Fixed in revision 10795.

New script added for making Postgres connections, runs both db.connect and db.login, connections is tested.

Radim

Work sponsored by [http://www.faunalia.it/]

#6 Updated by Paolo Cavallini over 15 years ago

Cannot start module qgis.db.connect-login.pg.py
command: /usr/share/qgis/grass/scripts//qgis.db.connect-login.pg.py --interface-description

Traceback (most recent call last): File "/usr/share/qgis/grass/scripts//qgis.db.connect-login.pg.py", line 75, in import grass ImportError: No module named grass

#7 Updated by Paolo Cavallini over 15 years ago

This is with grass 6.2.3

#8 Updated by Redmine Admin over 15 years ago

The Python ImportError was caused by missing PYTHONPATH when QGIS was run outside GRASS shell. This was in fact another bug (why it was not yet discovered? it should apply to all modules rewritten in Python (GRASS 7) ).

Fixed in revision 10814.

Radim

#9 Updated by Markus Neteler over 15 years ago

Please consider trac syntax: Fix is 5c1f3f8d (SVN r10815)

Also available in: Atom PDF