<!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 bgcolor="#ffffff" text="#000000">
On 10/21/2010 07:23 PM, Pablo Carreira wrote:
<blockquote cite="mid:SNT114-W15AB33CF89A9A96DFBD9B5D65D0@phx.gbl"
type="cite">
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>Hi,
<div><br>
</div>
<div><br>
</div>
<div>I have many vectors with tables and now I want to change my
database from sqlite to pgsql.</div>
<div>I ran db.connect. And now I need to copy all the tables from
sqlite to pgsql.</div>
<div>Is there an easy way to do that?</div>
<div><br>
</div>
</blockquote>
Once you've set the database connection params, then g.copy will create
a new vector with the attributes pushed into the new database. So you
could loop thru all vectors something like:<br>
for v in `g.mlist vect`; do <br>
g.rename vect=$v,$v_sqlite # rename to temporary name<br>
g.copy vect=$v_sqlite,$v # copy back to original name, but
pgsql tables will be created<br>
done<br>
<br>
If everything looks good, then you can remove all the vectors *_sqlite:<br>
g.remove vect=`g.mlist vect sep=, pat="*_sqlite"` <br>
<br>
<blockquote cite="mid:SNT114-W15AB33CF89A9A96DFBD9B5D65D0@phx.gbl"
type="cite">
<div>Thanks.</div>
<div>
<div><br>
Pablo Torres Carreira
<br>
<br>
</div>
</div>
<br>
<br>
This mail was received via Mail-SeCure System.<br>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
grass-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/grass-user">http://lists.osgeo.org/mailman/listinfo/grass-user</a>
This mail was received via Mail-SeCure System.
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Micha Silver
Arava Development Co. +972-52-3665918
<a class="moz-txt-link-freetext" href="http://surfaces.co.il">http://surfaces.co.il</a>
</pre>
</body>
</html>