Hologres supports a set of built-in extensions that add specialized capabilities to your database — from vector computing and spatial analysis to permission management and data masking. This page lists all supported extensions and explains how to load, view, and uninstall them.
Supported extensions | Load an extension | View loaded extensions | Uninstall an extension | FAQ
Limitations
An extension can be loaded into only one schema per database. For example, loading an extension into the default schema prevents you from loading it into any other schema in that database.
Load an extension into the
pg_catalogsystem schema to make it available across all schemas in the database. If no schema is specified, the extension loads into thepublicschema by default.Only accounts with Superuser permissions can load or uninstall extensions.
Currently, only built-in system extensions are supported. Custom or external extensions cannot be loaded.
Supported extensions
| Extension | Description | Schema constraint | Load command |
|---|---|---|---|
spm, slpm | Enable the simple permission model (SPM) or schema-level simple permission model (SLPM). See Use the SPM and Use the SLPM. | Loaded into the hologres schema by default. Schema cannot be changed. | CREATE EXTENSION IF NOT EXISTS spm; |
hive_compatible | Adds the get_json_object() function. See JSON functions. | Must be loaded into pg_catalog. | CREATE EXTENSION IF NOT EXISTS hive_compatible SCHEMA pg_catalog; |
hologres_fdw | Enables cross-database queries (Beta). See Cross-database queries. | Dedicated instances only. Must be loaded into pg_catalog. | CREATE EXTENSION IF NOT EXISTS hologres_fdw SCHEMA pg_catalog; |
dlf_fdw | Reads OSS data through DLF (Data Lake Formation). See Accelerate access to OSS data lakes based on DLF. | Must be loaded into pg_catalog. | CREATE EXTENSION IF NOT EXISTS dlf_fdw SCHEMA pg_catalog; |
proxima | Enables Proxima vector computing. See Proxima vector computing. | Dedicated instances only. Must be loaded into pg_catalog. | CREATE EXTENSION IF NOT EXISTS proxima SCHEMA pg_catalog; |
flow_analysis | Adds user segmentation and funnel analysis functions. See Funnel functions and User segmentation functions. | Loaded into the public schema by default. Can only be loaded into public. | CREATE EXTENSION IF NOT EXISTS flow_analysis; |
roaringbitmap | Adds Roaring Bitmap (RB) functions. See RoaringBitmap functions. | Dedicated instances only. Loaded into the public schema by default. Can only be loaded into public. | CREATE EXTENSION IF NOT EXISTS roaringbitmap; |
hg_binlog | Enables consuming Hologres Binlog data. See Consume Hologres Binlog data using JDBC. | Dedicated instances only. Loaded into the hologres schema by default. Schema cannot be changed. | CREATE EXTENSION IF NOT EXISTS hg_binlog; |
postgis | Adds PostGIS spatial functions. See PostGIS spatial functions. | Dedicated instances only. Must be loaded into pg_catalog. | CREATE EXTENSION IF NOT EXISTS postgis SCHEMA pg_catalog; |
clickhouse | Adds functions compatible with ClickHouse for migration. See Import data from ClickHouse. | Dedicated instances only. Loaded into the public schema by default. Can only be loaded into public. | CREATE EXTENSION IF NOT EXISTS clickhouse; |
pgcrypto | Adds the GEN_RANDOM_UUID function. See Random data functions. | Must be loaded into pg_catalog. | CREATE EXTENSION IF NOT EXISTS pgcrypto SCHEMA pg_catalog; |
bsi | Adds Bit Slice Index (BSI) functions. See BSI functions. | Loaded into the public schema by default. Can only be loaded into public. | CREATE EXTENSION IF NOT EXISTS bsi; |
hg_anon | Enables data masking. See Data masking. | Can only be loaded into pg_catalog. | CREATE EXTENSION IF NOT EXISTS hg_anon SCHEMA pg_catalog; |
mysql_compatible | Adds MySQL-compatible functions. See MySQL-compatible functions. | Loaded into the hologres schema by default. Schema cannot be changed. | CREATE EXTENSION IF NOT EXISTS mysql_compatible; |
Load an extension
Loading an extension into pg_catalog makes it available across all schemas in the database. If you load an extension into any other schema, its functions are only accessible within that schema's search_path.
Some extensions can only be loaded into a specific schema. Check the Schema constraint column in the table above before running the load command.
-- Requires Superuser permissions
CREATE EXTENSION IF NOT EXISTS <extension_name> SCHEMA <schema_name>;| Parameter | Description |
|---|---|
extension_name | The name of the extension. See the supported extensions table for valid values. |
schema_name | The schema to load the extension into. Use pg_catalog for database-wide availability. Defaults to public if omitted. |
Example: Load the postgis extension into pg_catalog:
CREATE EXTENSION IF NOT EXISTS postgis SCHEMA pg_catalog;View loaded extensions in the current database
Run the following query to list all extensions loaded in the current database, including those loaded by default:
SELECT
e.extname AS "Name",
e.extversion AS "Version",
n.nspname AS "Schema",
c.description AS "Description"
FROM
pg_catalog.pg_extension e
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = e.extnamespace
LEFT JOIN pg_catalog.pg_description c ON c.objoid = e.oid
AND c.classoid = 'pg_catalog.pg_extension'::pg_catalog.regclass
ORDER BY 1;Uninstall an extension
Do not use DROP EXTENSION <extension_name> CASCADE. The CASCADE option deletes all objects that depend on the extension, including PostGIS, RoaringBitmap, Proxima, Binlog, and BSI data, as well as metadata, tables, views, and server data.
-- Requires Superuser permissions
DROP EXTENSION <extension_name>;| Parameter | Description |
|---|---|
extension_name | The name of the extension to uninstall. See the supported extensions table for valid values. |
Example: Query an extension across schemas
Some extensions, such as roaringbitmap, can only be loaded into the public schema. If your table is in a different schema, calling an RB function without a schema prefix fails with function xxx does not exist. Prefix the function with public. to resolve this.
The following example demonstrates the issue and the fix.
Create a table in a non-
publicschema and populate it with data.CREATE EXTENSION roaringbitmap; CREATE SCHEMA test; -- Create a table in the test schema CREATE TABLE test.t1 ( id integer, bitmap roaringbitmap ); -- Insert a bitmap from an array INSERT INTO test.t1 SELECT 1, RB_BUILD(ARRAY[1, 2, 3, 4, 5, 6, 7, 8, 9, 200]); -- Insert a bitmap aggregated from a series INSERT INTO test.t1 SELECT 2, RB_BUILD_AGG(e) FROM GENERATE_SERIES(1, 100) e;Query using an RB function while
search_pathis set topublic. The query succeeds.SELECT RB_OR(a.bitmap, b.bitmap) FROM (SELECT bitmap FROM test.t1 WHERE id = 1) AS a, (SELECT bitmap FROM test.t1 WHERE id = 2) AS b;Switch
search_pathto thetestschema and run the same query. The query fails.SET search_path TO test; SELECT RB_OR(a.bitmap, b.bitmap) FROM (SELECT bitmap FROM test.t1 WHERE id = 1) AS a, (SELECT bitmap FROM test.t1 WHERE id = 2) AS b; -- ERROR: function rb_or(public.roaringbitmap, public.roaringbitmap) does not existPrefix the function with
public.to call it from the correct schema.SELECT public.RB_OR(a.bitmap, b.bitmap) FROM (SELECT bitmap FROM test.t1 WHERE id = 1) AS a, (SELECT bitmap FROM test.t1 WHERE id = 2) AS b;
FAQ
An extension was loaded into the wrong schema. After switching schemas, its functions are inaccessible and return `function xxx does not exist`.
This happens when an extension is loaded into the public schema but the active search_path no longer includes public. Uninstall the extension without CASCADE, then reload it into pg_catalog to make it accessible from all schemas:
DROP EXTENSION hologres_fdw;
CREATE EXTENSION IF NOT EXISTS hologres_fdw SCHEMA pg_catalog;