Connection of a vector map to a database table
To use GRASS 5.0 vector maps with the new GRASS 5.7, you first have to convert them to the new format: this can be made with v.convert. With GRASS 5.7 new Display Manager graphic interface a lot of display options and commands can be easily run. Press the first button on the top left corner, and selected map(s) will be displayed in the active monitor. To connect an external database to GRASS 5.7 just run db.connect on the terminal. Write the name of the database you want to connecgt to GRASS 5.7 and choose the right driver on the form: if you’re using a PostgreSQL database you have to select pg driver. The next step is to select a table from the database connected to GRASS 5.7, and link it to the vector map. To do this run v.db.connect. To extablish a connection between a vector map and a database table, map categories must match table keys or id of a certain field: the name of this field must be entered in the ‘key name’ box of the form. Press Run and on the form a warning appears: The table ‘table_name’ is now part of vector map ‘map_name’ and may be deleted or overwritten by GRASS modules. To display database data simply by clicking on the related graphic object of the map, run d.what.vect command. This command can be run from the console or from the Display Manager (pressing this button): in both cases the cursor becomes a cross and allows to interactively query the map. When an object is selected, another form appears, displaying all related db data. In the right form you can visualize all data (stored in the connected db table) linked to the selected vector object: these data can be erased or updated directly from the form. Source.