Bug #593
closedViewing VegBank tables directly
0%
Description
Bob, Mike Jennings, and Michael Lee need to be instructed (and given
permissions) to access the SQL prompt on VegBank to issue queries directly
against the database to view contents of the various tables. And we will need
the capacity to write these query results to file. Any more user friendly
approached that John might know of would be great. This is a critical step in
quality assurance dealing with the loading process.
Updated by Gabriel Farrell about 22 years ago
A user called qa has been setup for the database and server (contact me for
password)
INSTRUCTIONS:
psql is the command for sql access to database.
Please use man sql to get more information on usage. Below are some
things to get you started.
This sql shell has tab-completion, command history and many other user
friendly and powerfull features.
Connect to database:
$ psql [database_name]
i.e. plants_dev, plot_dev, communities_dev and framework
you should see;
db_name=#
now you can run commands or querys.
db_name=# \d
desribes current db (i.e.) lists tables
db_name=# select * from table;
run sql commands .. note the semi-colon
db_name=# \q
quit progam
Run a query and save output in a file:
db_name=# select plantname from plantconcept; \g outputfile
QUERY SWITCH FILENAME
Save all query results of this session to a file
db_name=# \o filename