[GRASS-user] Best way to reconnect tables in grass' databse

Nikos Alexandris nikos.alexandris at felis.uni-freiburg.de
Wed Nov 26 19:32:16 EST 2008


On Wed, 2008-11-26 at 20:14 +0000, Glynn Clements wrote:
> Nikos Alexandris wrote:
> 
> > I think I have questioned something similar but not quite the same
> > several months ago.
> > 
> > I moved the "grassdb" foldes (with all of its locations of course) in
> > another directory and thus, the absolute database path has been changed.
> > 
> > I need to re-connect all database tables. I think I am doing the right
> > thing by trying to use the v.db.reconnect.all module. However, I am a
> > bit confused about the appropriate format to be used for the
> > "old_database", "new_database" parameters.
> > 
> > Isn't it the absolute paths that are required?
> 
> For old_database=, it needs to be the exact string which appears as
> the fourth field of "v.db.connect -g", including the trailing "/"
> character if it is present.
> 
> For new_database=, the value is passed directly to v.db.connect's
> database= option, so it can be in any form which the driver accepts,
> including variable substitutions for the DBF driver.
> 
> The default database for the DBF driver is literally:
> 
> 	$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/
> 
> By "literally", I mean that's how it appears in the "dbln" file; the
> driver expands the variables whenever you access the data.
> 
> Any such maps don't need to be explicitly reconnected if you move the
> database.

Glynn & Company,

thank you. It worked :-)

Your explanation(s) are, as usual, precise. The parameter's names are
very clear. I got confused somehow from the fact the "v.db.connect -g"
prints out several "variables" and the help-text of "v.db.reconnect.all"
contains the word "variables" as well. So I stuck in "plural" :-?

My mistake of course. But adding your words *the string which appears as
the fourth field of "v.db.connect -g"* (or some other text) in
v.db.reconnect.all's description/help can't harm anyone.

Or maybe an example, in my case using sqlite as a DBMS, (for future
grass-adventurer's ;-):

v.db.reconnect.all
old_database="/home/nik/grassdb/peloponnese/hgrs87/PERMANENT/sqlite.db"
new_database="/geo/grassdb/peloponnese/hgrs87/PERMANENT/sqlite.db"

Kind regards, Nikos



More information about the grass-user mailing list