On 10/21/2010 07:23 PM, Pablo Carreira wrote:
Hi,


I have many vectors with tables and now I want to change my database from sqlite to pgsql. I ran db.connect. And now I need to copy all the tables from sqlite to pgsql.
Is there an easy way to do that?

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:
for v in `g.mlist vect`; do
    g.rename vect=$v,$v_sqlite  # rename to temporary name
g.copy vect=$v_sqlite,$v # copy back to original name, but pgsql tables will be created
done

If everything looks good, then you can remove all the vectors *_sqlite:
g.remove vect=`g.mlist vect sep=, pat="*_sqlite"`

Thanks.

Pablo Torres Carreira



This mail was received via Mail-SeCure System.


_______________________________________________
grass-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-user

This mail was received via Mail-SeCure System.




--
Micha Silver
Arava Development Co. +972-52-3665918
http://surfaces.co.il


_______________________________________________
grass-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to