[GRASSLIST:8713] Re: [GRASS5] Re: GIS Manager updates

Markus Neteler neteler at itc.it
Thu Oct 20 07:44:55 EDT 2005


Hamish wrote:

>dumb solution to remove a column, but it should work:
>
>db.copy select=
>
>only those columns you want to keep. (parse `db.describe -c` in a script)
>Then remove old table, rename new table, and reconnect.
>(v.db.droptable, v.db.connect; v.dbselect, ?)
>
>This could be written as a script, eg v.db.delcol
> (v.db.rmcol, v.db.removecol, v.db.dropcol,...)
>
>but again, a fairly cruddy solution. Is there a SQL command that could 
>be passed to db.execute?
>
>Hamish
>
Kirk R. Wythers wrote:

> On Oct 18, 2005, at 6:22 PM, Hamish wrote:
>
> postgres uses something like this:
>
> ALTER TABLE products ADD COLUMN description text;
>
> ALTER TABLE products DROP COLUMN description;
>

Maybe such a (needed) script has to distinguish between DBF driver and the
other real SQL drivers?

If connection == dbf then do_the_nasty_way
else
 use the ALTER command

? To implement DROP column into the DBF driver might be hard.

Markus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20051020/0a2d728e/attachment.html


More information about the grass-user mailing list