Opened 16 years ago

Closed 15 years ago

Last modified 15 years ago

#1173 closed bug (fixed)

db grass modules

Reported by: pcav Owned by: leolami
Priority: major: does not work as expected Milestone: Version 1.0.3
Component: GRASS Version: Trunk
Keywords: Cc: neteler, rblazek
Must Fix for Release: No Platform: All
Platform Version: Awaiting user input: no

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]

Change History (11)

comment:1 by neteler, 15 years ago

Cc: neteler added; neteler@… removed

comment:2 by neteler, 15 years ago

Sounds good to me.

Markus

comment:3 by pcav, 15 years ago

Priority: minor: annoyance or enhancementmajor: does not work as expected

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).

in reply to:  3 comment:4 by neteler, 15 years ago

Replying to 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

comment:5 by pcav, 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.

comment:6 by rblazek, 15 years ago

Resolution: fixed
Status: newclosed

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/

comment:7 by pcav, 15 years ago

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

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

comment:8 by pcav, 15 years ago

This is with grass 6.2.3

comment:9 by rblazek, 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

comment:10 by neteler, 15 years ago

Please consider trac syntax: Fix is r10814

comment:11 by rblazek, 15 years ago

Cc: rblazek added
Note: See TracTickets for help on using tickets.