SQL rename columns

From GRASS-Wiki
Revision as of 12:57, 3 October 2006 by Neteler (talk | contribs) (new article)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Q: I have imported successfully a large dataset to GRASS. After the import, the attribute columns are named like this: dbl_1 dbl_2...... I would like to change these names to something more friendly. I've tried some dbf editors but they allow only to change values but not the database structure.

A: You can change column names with Openoffice.org (Version 2). But take care to use 'oobase' (or: File -> New -> Database) to avoid problems with the number of rows. So, use 'oobase' to connect to your dbf file using the dbase driver (in the launch dialog chose "connect to existing database"). Then you don't have any problems with row number limits.

Notes:

  • In PostgreSQL there is an ALTER TABLE/RENAME COLUMN command.
  • For SQLite, use the sqlitebrowser browser.

See also