[GRASSLIST:9490] Re: switching to postgres

Radim Blazek radim.blazek at gmail.com
Thu Dec 15 03:34:59 EST 2005


On 11/3/05, Kirk R. Wythers <kwythers at umn.edu> wrote:
> > Or
> > g.copy vect=
> > g.remove vect=
> >
>
> Radim,
>
> Can you expand on this idea using g.copy? I tired db.copy with the
> command:

Each new vector will store attributes in database previously set by
db.connect. If you have a vector with attributes in dbf files,
you set your db to postgres (db.connect driver=pg datbase=...)
and then copy the old vector with g.copy the new one will use
postgres for attributes.

> GRASS 6.1.cvs (arrowhead_utm):~ > db.copy from_driver=dbf
> from_database=./ from_table=townships to_driver=pg
> to_database="host=localhost,dbname=ts2325" to_table=townships
>
> and got the error:
>
> DBMI-DBF driver error:
> Table 'townships' doesn't exist.
> Error in db_open_select_cursor()

That could be a bug in case you have townships.shp in your current directory.

Radim

> WARNING: Cannot open select cursor: 'select * from townships where 0
> = 1'
> WARNING: Copy table failed
>
> These messages imply that I need to create the Table
> "townships" (including all the columns and data typoes) before I can
> copy it from dbf. I was hoping to simply copy all the columns from
> the old dbf table to the new pg table
>
>
>




More information about the grass-user mailing list