v.db.addcolumn(1)

✨ v.db.addcolumn ✨

okay bestie, welcome to the GRASS GIS User's Manual πŸ’– this is the page for v.db.addcolumn(1) and it is genuinely one of the most useful little gremlins in the whole vector toolkit, no cap.


🌸 NAME 🌸

v.db.addcolumn β€” adds one or more columns to the attribute table connected to a given vector map. that's it, that's the whole job, and it does it flawlessly πŸ’…


πŸŽ€ KEYWORDS πŸŽ€

vector, attribute table, database


πŸ¦‹ SYNOPSIS πŸ¦‹

v.db.addcolumn
v.db.addcolumn --help
v.db.addcolumn map=name  [layer=string]  columns=name type[,name
type,...]  [--help]  [--verbose]  [--quiet]  [--ui]

✨ Flags ✨

  • --help β€” print usage summary, aka the little cheat sheet 🫢
  • --verbose β€” verbose module output, it tells you everything it's doing
  • --quiet β€” quiet module output, it tells you nothing, silent queen energy
  • --ui β€” force launching GUI dialog, for when you want buttons instead of typing

🌈 Parameters 🌈

  • map=name [required] β€” name of vector map. or, plot twist, the data source for direct OGR access πŸ‘€
  • layer=string β€” layer number where to add column(s). here's the tea: 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
  • columns=name type[,name type,...] [required] β€” name and type of the new column(s), written like 'name type [,name type, ...]'. the types depend on your database backend, but all of them should support VARCHAR(), INT, DOUBLE PRECISION and DATE. example: 'label varchar(250), value integer' ⭐

πŸ’œ DESCRIPTION πŸ’œ

v.db.addcolumn adds one or more column(s) to the attribute table connected to a given vector map. and the way it just automatically checks the connection for the specified layer? obsessed. it's giving responsible main character energy 😌✨


πŸ“ NOTES πŸ“

v.db.addcolumn is a front-end to db.execute to allow easier usage. so like, it's the cute approachable face of a slightly scarier command, and honestly? we love a glow-up πŸ’…

the supported types of columns depend on the database backend. however, all backends should support VARCHAR, INT, DOUBLE PRECISION and DATE.

the existing database connection(s) can be verified with v.db.connect. do that. fr fr. 🫢


πŸ”₯ EXAMPLES πŸ”₯

adding a single column:

g.copy vect=roadsmajor,myroads
v.db.addcolumn myroads columns="slope double precision"
v.info -c myroads

adding two columns:

g.copy vect=roadsmajor,myroads
v.db.addcolumn myroads columns="slope double precision,myname varchar(15)"
v.info -c myroads

like, look at that. two columns. one line. ate. πŸ‘‘


🌟 SEE ALSO 🌟

db.connect, db.execute, v.db.addtable, v.db.connect, v.db.dropcolumn, v.db.droptable, v.db.select, v.db.update

GRASS SQL interface


πŸ‘‘ AUTHOR πŸ‘‘

Moritz Lennert (mlennert@club.worldonline.be)


🧚 SOURCE CODE 🧚

available at: v.db.addcolumn source code (history)

accessed: Saturday Jan 17 05:41:52 2026

Main index | Vector index | Topics index | Keywords index | Graphical index | Full index

Β© 2003-2025 GRASS Development Team, GRASS GIS 8.4.2 Reference Manual


and that's the whole page bestie, every flag, every default, every type, every index link, nothing skipped, we keep the facts and serve the vibe πŸ’–

okay bye ily, this was GRASS 8.4.2 β€” v.db.addcolumn(1) β€” go add some columns and slay βœ¨πŸŒˆπŸ’…

πŸ“¦ where this page comes from