v.db.renamecolumn(1grass)
β¨ v.db.renamecolumn β¨
okay bestie, welcome to the v.db.renamecolumn page from the GRASS User's Manual π this is the lil legend that renames a column in the attribute table that's connected to a given vector map. iconic behavior fr fr.
π NAME π
v.db.renamecolumn β renames a column in the attribute table connected to a given vector map. yes, that's literally its whole job and it does it flawlessly π
π KEYWORDS π
vector, attribute table, database, rename
π¦ SYNOPSIS π¦
v.db.renamecolumn
v.db.renamecolumn --help
v.db.renamecolumn map=name [layer=string] column=oldcol,newcol
[--help] [--verbose] [--quiet] [--ui]
πΈ Flags πΈ
--helpβ prints the usage summary, aka the lil cheat sheet π«Ά--verboseβ verbose module output, for when u wanna see EVERYTHING π--quietβ quiet module output, shhh π€«--uiβ force launches the GUI dialog, if u fw clicking instead of typing β¨
π Parameters π
map=name[required] β name of vector map. or, plot twist, a data source for direct OGR access πlayer=stringβ layer number or name. vector features can have category values in different layers, and this number determines which layer to use. when used with direct OGR access, this is the layer name instead. default:1πcolumn=oldcol,newcol[required] β old and new name of the column, written as(old,new)π«
π DESCRIPTION π
v.db.renamecolumn renames a column in the attribute table connected to a given vector map. it automatically checks the connection for the specified layer, so u don't have to do the detective work urself. it's giving considerate π₯°
π NOTES π
ok so this is the tea, bestie, listen up π΅
if the map table is connected through the DBF or SQLite drivers, the renaming is internally done by adding a new column with the new name, transferring the contents of the old column to the new column, and then dropping the old column. why?? because DBF and SQLite simply do NOT support the "ALTER TABLE" command for renaming columns. not their fault, they're just built different π
due to this, the renamed column ends up as the last column of the table β its original position cannot be maintained. so if ur a creature of habit and wanted it in the same spot, sorry babe, that's just how it is π
β οΈ heads up: the SQLite driver will exit with an error if the column rename involves only a change of case β like upper-to-lowercase, or lower-to-uppercase. the SQLite protocol considers"NAME"and"name"to be identical column names. in cases like these, the user should rename the original column to an intermediary name, then rename the intermediary to the final name. two-step it, periodt βοΈ
π EXAMPLES π
renaming a column, watch and learn π¬
g.copy vect=roadsmajor,myroads
v.info -c myroads
v.db.renamecolumn myroads column=ROAD_NAME,roadname
v.info -c myroads
π«Ά SEE ALSO π«Ά
db.execute, v.db.addcolumn, v.db.addtable, v.db.connect, v.db.dropcolumn, v.db.droptable, v.db.select, v.db.update
GRASS SQL interface
β AUTHOR β
Markus Neteler β ty for ur service legend π«‘
π SOURCE CODE π
Available at: v.db.renamecolumn source code (history)
Latest change: Tuesday Jun 24 05:57:51 2025 in commit: 801e552cdaf8ef40f8760dbbcc5a4a5b83b14d40
Main index | Vector index | Topics index | Keywords index | Graphical index | Full index
Β© 2003-2026 GRASS Development Team, GRASS 8.5.0 Reference Manual
and that's the whole page bestie, no cap π§ this was v.db.renamecolumn from GRASS 8.5.0, last updated in that June 24 2025 commit 801e552cdaf8ef40f8760dbbcc5a4a5b83b14d40 π go rename some columns and slay π
β¨
π¦ where this page comes from
- alpine 3.24: grass-gis-doc 8.5.0-r1 Β· GPL-2.0-or-later
- ubuntu stonking: grass-doc 8.5.0-1ubuntu1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms