Scroll to navigation

db.columns(1grass) GRASS User's Manual db.columns(1grass)

NAME

db.columns - List all columns for a given table.

KEYWORDS

database, attribute table

SYNOPSIS

db.columns
db.columns --help
db.columns [-e] table=name [driver=name] [database=name] [separator=character] format=name [--help] [--verbose] [--quiet] [--ui]

Flags:


Print type information about the columns
Print the name and the type of all the columns for a given table.

Print usage summary

Verbose module output

Quiet module output

Force launching GUI dialog

Parameters:


Name of attribute table

Name of database driver
Options: dbf, mysql, odbc, ogr, pg, sqlite
Default: sqlite

Name of database
Default: $GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db

Field separator
Special characters: pipe, comma, space, tab, newline

Output format
Options: plain, csv, json, list
Default: plain
plain: Configurable plain text output
csv: CSV (Comma Separated Values)
json: JSON (JavaScript Object Notation)
list: Output in list format

DESCRIPTION

db.columns lists all columns for a give table. Connection to databases are supported through dbf, shp, odbc and pg drivers.

NOTE

If parameters for database connection are already set with db.connect, they are taken as default values and do not need to be specified each time.

EXAMPLES

List columns of a PostgreSQL attribute table

db.columns table=zipcodes_wake driver=pg database=grassdb

If the database parameters are already set, the columns can be listed directly

db.columns table=zipcodes_wake

List columns from Shape file with DBF attribute table

db.columns table=zipcodes_wake driver=dbf database=/grassdata/nc_spm_08/PERMANENT/dbf/

List columns of table in SQLite database

Note that the SQLite backend is the default setting.

db.columns driver=sqlite table=archsites database=’$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db’

SEE ALSO

db.connect, db.describe, db.drivers, db.droptable, db.execute, db.login, db.tables, GRASS SQL interface

GRASS SQL interface

AUTHOR

Radim Blazek, ITC-Irst, Trento, Italy

SOURCE CODE

Available at: db.columns source code (history)

Latest change: Saturday Jan 31 03:52:33 2026 in commit: 5dd1f9083055d3047f66dba6c3aec01c50dbdf2d

Main index | Database index | Topics index | Keywords index | Graphical index | Full index

© 2003-2026 GRASS Development Team, GRASS 8.5.0RC1 Reference Manual

GRASS 8.5.0RC1