Getting Started JChem PostgreSQL Cartridge¶
This guide will serve as a basic introduction to installing and using JChem PostgreSQL Cartridge (JPC).
See also Installation and Administration and API Usage pages for detailed description of administration and API use cases.
System requirement¶
- CentOS, RedHat, Debian or Ubuntu operating system x86_64 version.
Find information for cases of other linux systems
- postgreSQL 9.4 relational database (preferred download page) for JPC versions up to 2.0
- postgreSQL 9.5 relational database for JPC versions starting from 2.1
See help to Upgrade of PostgreSQL database together with JPC
- postgreSQL 10 relational database for JPC versions starting from 3.0
- postgreSQL 12 relational database for JPC versions starting from 5.0
- availability of hstore extension of postgresql (e.g., contrib package)
- Java8 runtime environment. We support AdoptOpenJDK 8 as well. In the case of AdoptOpenJDK libfontconfig package must be included.
Installation and Setup¶
Install PostgreSQL Cartridge¶
Download the latest version of PostgreSQL Cartridge from here. In order to install the latest version, change ** x.y ** (version information) in the following statement to the current one:
In CentOS or RedHat:
In Debian:
Before the first use¶
-
Install your license file
Copy a valid ChemAxon license to
/etc/chemaxon/license.cxl. Required license in the license file is 'Postgres Cartridge'. The jchem-psql user should have read access to the license file. -
Initialize index directory
{primary}
If you encounter a problem in your java installation, set yourJAVA_HOMEin the file/etc/default/jchem-psql.
-
First start
Using the extension in a database¶
-
Create postgres user and database
-
Install the extensions
-
Checking JChem-psql cartridge installation
If
jchem-psqlservice is running, the following query can be executed without any problem:
Service¶
The service can be started/stopped using
By default, the service starts on system boot. This can be switched off by setting ENABLED=0 in the /etc/default/jchem-psql file.
BASIC API Usage¶
CREATE TABLE¶
Example:
Import data¶
- Import from sdf/mol file (located on your local machine):
Example:
CREATE INDEX¶
Indextype named chemindex has to be used when indexing a column that contains chemical structures.
Example:
SELECT¶
Substructure search
Examples:
Full fragment (exact fragment) search
Example:
Superstructure search
Example:
Duplicate search
Example: