[GRASSLIST:8040] Re: remove, rename column in DBF

Jachym Cepicky jachym.cepicky at centrum.cz
Wed Aug 24 03:24:03 EDT 2005


> 1. change a column name

You have to create temporal table without the column, fill it with
values, delete the original table and rename the temporal table :-/

for postgres:
    CREATE TABLE temp AS SELECT column1,column2 FROM table;
    DROP TABLE table;
    CREATE TABLE table ( column1 (type), column2 (type));
    INSERT INTO table SELECT * FROM temp;
    DROP TABLE temp;

> 2. remove a column

if you are using postgres, there is RENAME key word:
    ALTER TABLE table RENAME COLUMN column to new_column;

however it seems not to work with DBF driver

> in DBF datatables, Grass 6.1 CVS.
> Can somebody please tell if this is indeed impossible?
> What program do you recommned for manipulating DBFs? GUI preferably but I 
> wouldn't mind a console program.
> Without remove/rename column functionality I cannot proceed with my current 
> task, and OpenOffice.org's limit od 32767 rows is much too litle for my 
> data.

I would recommned you to use Postgres for storing atribute data. There
is lot of good documentation for it (http://www.postgresql.org/docs/8.0/static/ddl-alter.html) and it can be used realy fast.

Hope, it helps...

Jachym Cepicky
e-mail: jachym.cepicky at centrum.cz
URL: http://les-ejk.cz
GPG: http://les-ejk.cz/gnupg_public_key/

More information about the grass-user mailing list