Viewing VegBank tables directly
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.
#1 Updated by Gabriel Farrell over 18 years ago
A user called qa has been setup for the database and server (contact me for
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;
now you can run commands or querys.
desribes current db (i.e.) lists tables
db_name=# select * from table;
run sql commands .. note the semi-colon
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