[OPEN-ILS-DEV] ***SPAM*** Using PSQL with Evergreen's Database. Re: Want to know the variable name of patron's phone number

Steve Wills swills at beyond-print.com
Sun Jan 8 03:21:31 EST 2012


 I tried to respond before but my email didn't make it onto the list for some reason. This is my second try.

Darshan,

You need the right database, by default it is called evergreen. In postgres, your previous posts indicate that you can get into psql. pgadmin and other gui tools are cool but fundamentally one wants to understand the underlying database. psql strips away the gui and forces you to think only about the database, it might speak to the difficulty you are having.

first, in psql, use the \l tool to see what databases you have in your postgres instance. Usually, your Evergreen database will be called evergreen unless you had done something proactive to change that name.

postgres#\c evergreen 

this command should attach you to your evergreen database. Now you probably want to see the tables. While it is tempting to type \d and see tables, evergreen aggregates it's tables into functional schema. You must know what these schema are in order to interact with the tables they govern. To get a list of those tables, use the command \dn which should yield a list like:

 List of schemas
 Name | Owner 
---------------------+-----------
 acq | postgres
 action | postgres
 action_trigger | postgres
 actor | postgres
 asset | postgres
 auditor | postgres
 authority | postgres
 biblio | postgres
 booking | evergreen
 config | postgres
 container | postgres
 evergreen | evergreen
 extend_reporter | postgres
 information_schema | postgres
 metabib | postgres
 migration | postgres
 money | postgres
 offline | postgres
 permission | postgres
 pg_catalog | postgres
 pg_toast | postgres
 pg_toast_temp_1 | postgres
 pg_toast_temp_2 | postgres
 public | postgres
 query | evergreen
 reporter | postgres
 search | postgres
 serial | postgres
 staging | evergreen
 stats | postgres
 vandelay | postgres
(31 rows)



More information about the Open-ils-dev mailing list