<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body dir="ltr" bgcolor="#ffffff" text="#000000">
<p style="margin-bottom: 0cm; margin-top: 0pt;">Rich Shepard wrote:<br>
</p>
<blockquote
cite="mid:alpine.LNX.2.00.1103131141520.3145@salmo.appl-ecosys.com"
type="cite">On Sat, 12 Mar 2011, Micha Silver wrote:
<br>
<br>
<blockquote type="cite">Furthermore, if you're going to change the
whole project over to database stored attribs, then the best method is
to set the new database connection for your mapset (db.connect +
db.login) then just run db.copy on all your vectors. All the new
"copies" will have their data tables in the (now default) database.
<br>
</blockquote>
<br>
Micha,
<br>
<br>
I set db.connect to the postgres server at localhost (using
db_driver=pg)
<br>
and don't need to explicitly login. Following the example on the manual
page
<br>
I must have missed something:
<br>
<br>
GRASS 6.5.svn (Nevada-aea):~/grassdata > db.copy from_driver=dbf
<br>
from_database=$HOME/grassdata/nevada-aea/PERMANENT/dbf
<br>
from_table=at_risk_species to_driver=pg
<br>
to_database="host=localhost,dbname=nevada" to_table=at_risk_species
<br>
DBMI-DBF driver error:
<br>
Cannot create dbf database:
<br>
/home/rshepard/grassdata/nevada-aea/PERMANENT/dbf
<br>
<br>
WARNING: Unable to open database <dbf> by driver
<br>
</home/rshepard/grassdata/nevada-aea/PERMANENT/dbf>
<br>
Segmentation fault
<br>
<br>
I don't want to create the dbf database, but copy the data from it.
Must
<br>
be a syntax error I made that I don't see. But, it caused grass to
segfault.
<br>
Hmmm-m-m-m.
<br>
</blockquote>
<br>
Hmmm is right.<br>
On my (debian) I get:<br>
<br>
# check columns in a vector<br>
GRASS 6.4.0RC6 (ITM):~ > v.info -c idan_catchments<br>
Displaying column types/names for database connection of layer 1:<br>
INTEGER|cat<br>
CHARACTER|label<br>
DOUBLE PRECISION|area_sqm<br>
INTEGER|area_dunam<br>
<br>
# Which current db connection?<br>
GRASS 6.4.0RC6 (ITM):~ > v.db.connect -p idan_catchments<br>
Vector map <idan_catchments@idan> is connected by:<br>
layer <1> table <idan_catchments> in database
</home/micha/geodata/grass/ITM/idan/dbf/> through driver
<dbf> with key <cat><br>
GRASS 6.4.0RC6 (ITM):~ > <br>
<br>
# Copy to postgres<br>
GRASS 6.4.0RC6 (ITM):~ > db.copy from_dri=dbf to_dri=pg
to_data="host=localhost,dbname=geodata" from_tab=idan_catchments
to_tab=idan_catchments<br>
<br>
# Check for data in new table<br>
GRASS 6.4.0RC6 (ITM):~ > psql -d geodata -c "SELECT * FROM
idan_catchments"<br>
cat | label | area_sqm | area_dunam <br>
-----+-------+--------------+------------<br>
2 | | 455240.625 | 455<br>
4 | | 9070862.5 | 9070<br>
6 | | 1637971.875 | 1637<br>
8 | | 11677375 | 11677<br>
10 | | 2449587.5 | 2449<br>
12 | | 4955384.375 | 4955<br>
14 | | 5248571.875 | 5248<br>
16 | | 7726990.625 | 7726<br>
18 | | 2845550 | 2845<br>
......<br>
<br>
<br>
Why don't you try with g.copy?<br>
<br>
<br>
<blockquote
cite="mid:alpine.LNX.2.00.1103131141520.3145@salmo.appl-ecosys.com"
type="cite"><br>
Clue appreciated,
<br>
<br>
Rich
<br>
<br>
_______________________________________________
<br>
grass-user mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a>
<br>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/grass-user">http://lists.osgeo.org/mailman/listinfo/grass-user</a>
<br>
<br>
This mail was received via Mail-SeCure System.
<br>
<br>
<br>
</blockquote>
<br>
</body>
</html>