Skip to content

rdkit

Cheminformatics functionality for PostgreSQL.

Overview

PackageVersionCategoryLicenseLanguage
rdkit202609.1FEATBSD-3-ClauseC++
IDExtensionBinLibLoadCreateTrustRelocSchema
2930rdkitNoYesNoYesNoYes-

RDKit 2026.09.1 (package 202609.1) installs SQL extension 4.8.0. Modern recipes target EL9+, Trixie, Noble and Resolute; DEB supports PG14-18 across suppliers. Legacy Bookworm/Jammy recipes use 202303.3 with librdkit1; modern DEB uses librdkit1t64.

Version

TypeRepoVersionPG VerPackageDeps
EXTPIGSTY202609.11817161514rdkit-
RPMPIGSTY202609.11817161514rdkit_$vrdkit
DEBPIGSTY202609.11817161514postgresql-$v-rdkit-
OS / PGPG18PG17PG16PG15PG14
el8.x86_64
el8.aarch64
el9.x86_64
el9.aarch64
el10.x86_64
el10.aarch64
d12.x86_64
d12.aarch64
d13.x86_64
d13.aarch64
u22.x86_64
u22.aarch64
u24.x86_64
u24.aarch64
u26.x86_64
u26.aarch64

Build

You can build the RPM / DEB packages for rdkit using pig build:

pig build pkg rdkit         # build RPM / DEB packages

Install

You can install rdkit directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:

pig repo add pgsql -u          # Add repo and update cache

Install the extension using pig or apt/yum/dnf:

Install
pig install rdkit;          # Install for current active PG version
pig
pig ext install -y rdkit -v 18  # PG 18
pig ext install -y rdkit -v 17  # PG 17
pig ext install -y rdkit -v 16  # PG 16
pig ext install -y rdkit -v 15  # PG 15
pig ext install -y rdkit -v 14  # PG 14
dnf
dnf install -y rdkit_18       # PG 18
dnf install -y rdkit_17       # PG 17
dnf install -y rdkit_16       # PG 16
dnf install -y rdkit_15       # PG 15
dnf install -y rdkit_14       # PG 14
apt
apt install -y postgresql-18-rdkit   # PG 18
apt install -y postgresql-17-rdkit   # PG 17
apt install -y postgresql-16-rdkit   # PG 16
apt install -y postgresql-15-rdkit   # PG 15
apt install -y postgresql-14-rdkit   # PG 14

Create Extension:

CREATE EXTENSION rdkit;

Usage

Sources:

rdkit provides molecular types, substructure search, fingerprints and chemical descriptors. This page follows the PostgreSQL cartridge shipped in RDKit 2026.03.6.

Create The Extension

CREATE EXTENSION rdkit;

The cartridge adds chemistry-specific types including mol, bfp, and sfp.

Core Search Operators

The cartridge documentation covers:

  • @> and <@ for substructure matching.
  • @= for exact molecular equality.
  • %, <%>, and <#> style fingerprint similarity and KNN operators for similarity search.

These are typically combined with GiST indexes over fingerprint columns.

Fingerprints And Similarity

Common fingerprint functions documented for SQL usage include morgan_fp, morganbv_fp, featmorgan_fp, rdkit_fp, atompair_fp, torsion_fp, layered_fp, and maccs_fp.

Example from the cartridge docs:

SELECT tanimoto_sml(
  morganbv_fp('c1ccccc1'::mol),
  morganbv_fp('c1ccccc1O'::mol)
);

Descriptors And Validation

The cartridge docs also expose validation and descriptor helpers such as:

  • is_valid_smiles()
  • is_valid_ctab()
  • is_valid_smarts()
  • mol_amw()
  • mol_hba()
  • mol_numrings()

These functions are the main user-facing surface for SQL analytics on molecular structures.

Version and Upgrade Boundary

The RDKit toolkit release 2026.03.6 contains SQL extension version 4.8.0; these are different version namespaces. The upstream 4.7.0 to 4.8.0 SQL template changes function costs, but its fmcs_smiles statement has a line comment that swallows the cost clause and terminator. Do not assume an unpatched ALTER EXTENSION rdkit UPDATE path works: verify the installed upgrade script and test the update on a restored copy first. A packaging patch is distinct from the upstream source.

Was this page helpful?