Cache Database

Postgres

Administration of the databases

To create a Postgres cache database, you must be connected with a server running Postgres  (Version 12.0 or above). To connect to a server, click on the
button and enter the connection parameters. If no cache database has been created so far you get a message that no database is available and will be connected to the default database postgres.\

Click on the button to create a new cache database (see below). You will be asked for the name of
the database and a short description.

After the database was created, you have to update the database to the current version. Click on the Update
button to open a window listing all needed scripts. To run these scripts just click on the
Start update button. After the update the database is ready to take your data. Subsequent
updates may become necessary with new versions of the database. For an introduction see a short tutorial
.
To remove the current database from the server, just click on the button.

In the image on the right you see a screenshot from the tool pgAdmin III. You may use this tool
to inspect your data and administrate the database independent from DiversityCollection. Please keep in mind, that any
changes you insert on this level may disable your database from being used by DiversityCollection as a sink for your cache
data. The data are organized in schemata, with public as the default
schema. Here you find functions for marking the database as a module of the Diversity
Workbench and the version of the database. The function highresolutionimagepath translates local image paths into paths for high resolution images. To use this function it must be adapted to your local server settings. The tables in this schema
are TaxonSynonymy where the data derived from DiversityTaxonNames are stored and
ScientificTerm where the data derived from DiversityScientificTerms are stored. For every project a separate schema is created (here Project_BFLsorbusmmcoll). The project schemata contain 2
functions for the ID of the project and the version. The data are stored in the
tables while the packages in their greater part are realized as
views and functions extracting and converting the data from the
tables according to their requirements. 

Subsections of Cache Database

Cache Database Postgres

Replace DB

Replace Postgres databases

To replace a database with another, click on the button. A window as below will appear. After you selected the database, which should be replaced, the software will compare the two databases and list differences (see below). If differences are found and you still want to replace the database, click on the [ Enable incongruent replacement ] button, to allow this. Then click no the Replace button. The database that should be replaced will be deleted and the current database will get the name of the replaced database.

The option  Restrict to sources with critical content  will restrict the output of the test to the main table as well as tables with content regarded as critical for a replacement. If you deselect this option, all tables will be listed as shown below.

If the number of datasets in a table corresponds in both databases, this table is regarded as congruent and marked with a (see above). If content is new, this will be marked with a and not regarded as critical. On the other hand missing content will be regarded as critical and marked with a (see below).

If the number of datasets differ between tables, but are not missing in eiter, this will be regarded as not critical and marked with (see below).

Further states for comparision of the tables are:

  • Update when any part needs an update to the current version.
  • Error when a part is missing as a whole.

With the option  Keep a copy of the current database a copy of the original database will be kept.

 

 

 

Cache Database Postgres

Copy & Replace DB

Copy Postgres databases

To copy a Postgres database, click on the  button. A window will appear where you can copy the database including the data or as an empty database with the same tables etc. as the original database.

The option including the data only needs the name for the new database (see below).

To create an empty copy, you have to give the directory where two needed programs (pg_dump.exe and psql.exe) are located. If these are missing, you have to install [ Postgres ]first.

If you create an empty copy, a window will appear two times (see below) where you have to enter the password for accessing the database.

 

Replace Postgres databases

see chapter

 

Rename Postgres databases

To rename the current database, click on the button. A window will open where you can enter the new name for the database. Click OK to change the name..

 

Delete Postgres databases

To delete the current database just click on the button. You will get a message if you are sure where you have to click the YES button to delete the current database.