The following table lists all of the extensions supported by
AlloyDB.

All of these extensions are available on every AlloyDB instance.
To enable any of them, see [Enable an extension](https://docs.cloud.google.com/alloydb/docs/instance-configure-extensions.md.txt#enable).

Note that some extensions require additional steps before you can enable
them---typically, by [setting one or more database
flags](https://docs.cloud.google.com/alloydb/docs/instance-configure-database-flags) on your instances.

## AlloyDB-specific extensions

| Extension | Latest supported version | Description |
|---|---|---|
| `alloydb_scann` | 0.1.3 | Implements a highly efficient nearest-neighbor index powered by the [ScaNN algorithm](https://github.com/google-research/google-research/blob/master/scann/docs/algorithms.md). This extension is used along with the `vector` extension to enhance vector search capabilities and provides support for storing and querying vector embeddings. |
| `google_columnar_engine` | 10.5 (PostgreSQL 15) 10.6 (PostgreSQL 16 and later) | Provides the columnar engine feature of AlloyDB, which handles HTAP (hybrid transactional analytical processing) and OLAP (online analytical processing) workloads very efficiently. > [!IMPORTANT] > **Important:** Before you can use `CREATE EXTENSION` to enable this extension, you must first [set the database flag](https://docs.cloud.google.com/alloydb/docs/instance-configure-database-flags.md.txt) `google_columnar_engine.enabled` to the value `on` in the AlloyDB instance where you want to use the extension. |
| `google_db_advisor` | 1.1 | Provides the index advisor feature of AlloyDB, which recommends indexes to speed up query processing. |
| `google_ml_integration` | 1.6.4 | Provides functions you use to register model endpoints and generate embeddings or invoke predictions in SQL. |
| `google_plan_management` | 1.0 | Provides functions you use to manage your query plans using query plan management for consistent query plan selection. This feature is available in [Preview](https://cloud.google.com/products?e=48754805&#product-launch-stages). |
| `parameterized_secure_views` | 1.0 | Provides application data security and row access control using SQL views to make sure that application users can only view authorized data. > [!WARNING] > **Preview > --- Parameterized Secure Views** > This feature is > subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the > [Service Specific > Terms](https://docs.cloud.google.com/terms/service-terms#1). > Pre-GA features are available "as is" and might have limited support. > For more information, see the > [launch stage descriptions](https://cloud.google.com/products/#product-launch-stages). |

## Foreign data wrapper (FDW) extensions

| Extension | Latest supported version | Description |
|---|---|---|
| `bigquery_fdw` | 1.1 | Provides a foreign data wrapper (FDW) for querying data residing in BigQuery in real time. |
| `external_search_fdw` | 1.0 | Provides shallow, read-only integration between AlloyDB and external search backends including [OpenSearch](https://docs.cloud.google.com/alloydb/docs/opensearch.md.txt), [Elasticsearch](https://docs.cloud.google.com/alloydb/docs/elastic-search.md.txt), and [Solr](https://docs.cloud.google.com/alloydb/docs/solr-search.md.txt). |
| `oracle_fdw` | 1.2 | Provides a foreign data wrapper (FDW) for accessing Oracle databases easily and efficiently. > [!CAUTION] > **Caution:** Clusters running on N2 machine types use an Oracle 21c client which has a known issue when accessing `BLOB` columns using the `oracle_fdw` extension. > **Workaround:** Until a fix is available, you can mitigate this issue by using a cluster created on the C4A machine series image, which utilizes a stable Oracle 19c client and requires the latest database maintenance update. |
| `postgres_fdw` | 1.1 | Provides a foreign data wrapper that you can use to access data stored in external PostgreSQL servers. |
| `tds_fdw` | 2.0.5 | Provides a foreign data wrapper (`fdw`) for accessing databases that use the Tabular Data Stream (TDS) protocol, such as Microsoft SQL Server or Sybase. |

## Data type extensions

| Extension | Latest supported version | Description |
|---|---|---|
| `citext` | 1.6 | Provides a case-insensitive character string type `citext`. |
| `cube` | 1.5 | Implements a data type `cube` for representing multidimensional cubes. |
| `hstore` | 1.8 | Implements the `hstore` data type for storing sets of key/value pairs within a single PostgreSQL value. |
| `ip4r` | 2.4 | Provides data types for IPv4/v6 addresses, and address ranges, plus index support. |
| `isn` | 1.2 | Provides data types for some international product numbering standards. |
| `lo` | 1.1 | Provides support for managing Large Objects, also called LOs or BLOBs. |
| `ltree` | 1.2 | Implements a data type `ltree` for representing labels of data stored in a hierarchical tree-like structure. |
| `postgresql-hll` | 2.20 | Introduces a new data type, `hll`, which is a HyperLogLog data structure. |

## Language extensions

| Extension | Latest supported version | Description |
|---|---|---|
| `plpgsql` | 1.0 | Provides a loadable procedural language for creating functions, procedures, and triggers. You also can use this language for direct execution of code in `DO` blocks. |
| `plproxy` | 2.12.0 | Provides a procedural language handler that lets you make remote procedure calls among PostgreSQL databases, with optional sharding. |
| `plv8` | 3.2.3 | Provides a procedural language for enabling JavaScript. |

## Miscellaneous extensions

| Extension | Latest supported version | Description |
|---|---|---|
| `amcheck` | 1.3 | Provides functions for verifying the logical consistency of the structure of relations, enabling the `pg_amcheck` application to check for corruption. |
| `anon` | 1.3.2 | Helps you hide or replace personally identifiable information (PII) or commercially sensitive data. > [!IMPORTANT] > **Important:** Before you can use `CREATE EXTENSION` to enable this extension, you must first [set the database flag](https://docs.cloud.google.com/alloydb/docs/instance-configure-database-flags.md.txt) `alloydb.enable_anon` to the value `on` in the AlloyDB instance where you want to use the extension. |
| `auto_explain` | 1.0 | Enables automatic logging of execution plans of slow statements, for troubleshooting and more. It provides an automated way to perform the functionality of the `EXPLAIN` command. > [!IMPORTANT] > **Important:** Before you can use the `LOAD` command to enable this extension, you must first [set the database flag](https://docs.cloud.google.com/alloydb/docs/instance-configure-database-flags.md.txt) `alloydb.enable_auto_explain` to the value `on` in the AlloyDB instance where you want to use the extension. > Alternatively, you can connect to a database as a user that's a member > of the `alloydbsuperuser` role and use the command > `LOAD 'auto_explain'` to load this extension for one > session. |
| `autoinc` | 1.0 | Provides functions for incrementing fields automatically. This trigger stores the next value of a sequence into an integer field. |
| `bloom` | 1.0 | Provides an index access method based on Bloom filters. |
| `btree_gin` | 1.3 | Provides sample GIN operator classes that implement B-tree equivalent behavior. |
| `btree_gist` | 1.7 | Provides GiST index operator classes that implement B-tree equivalent behavior. |
| `dblink` | 1.2 | Provides functions to connect to PostgreSQL databases from within a database session. |
| `dict_int` | 1.0 | Provides an add-on dictionary template for full-text search that controls the indexing of integers. |
| `earthdistance` | 1.1 | Provides two approaches to calculating great circle distances on the surface of the Earth. |
| `fuzzystrmatch` | 1.1 | Provides several functions to determine similarities and distance between strings. |
| `hypopg` | 1.3.2 | Provides support for hypothetical indexes. |
| `insert_username` | 1.0 | Provides functions for storing the current user's name into a text field. You can use these functions to track which user last modified a row in a database table. |
| `intagg` | 1.1 | Provides an integer aggregator and an enumerator. |
| `intarray` | 1.5 | Provides a set of functions and operators for manipulating null-free arrays of integers and performing indexed searches on them. |
| `moddatetime` | 1.0 | Provides functions for storing the current time into a `timestamp` field. You can use these functions to track the last time that a row in a database table was modified. |
| `orafce` | 4.13 | Emulates a subset of functions, packages, and operators from the Oracle RDBMS. |
| `pageinspect` | 1.11 | Inspects the contents of database pages at a low level. |
| `pg_background` | 1.4 | Lets you run arbitrary commands in a background worker. |
| `pg_bigm` | 1.2 | Provides full text search capability in PostgreSQL using 2-gram (bigram) indexes for faster full text searches. > [!IMPORTANT] > **Important:** Before you can use `CREATE EXTENSION` to enable this extension, you must first [set the database flag](https://docs.cloud.google.com/alloydb/docs/instance-configure-database-flags.md.txt) `alloydb.enable_pg_bigm` to the value `on` in the AlloyDB instance where you want to use the extension. |
| `pg_buffercache` | 1.3 | Lets you examine the shared buffer cache in real time. |
| `pg_cron` | 1.6.7 | Provides a cron-based job scheduler for PostgreSQL that runs inside the database as an extension. It uses the same syntax as regular `cron`, but it lets you schedule PostgreSQL commands directly from the database. > [!IMPORTANT] > **Important:** Before you can use `CREATE EXTENSION` to enable this extension, you must first [set the database flag](https://docs.cloud.google.com/alloydb/docs/instance-configure-database-flags.md.txt) `alloydb.enable_pg_cron` to the value `on` in the AlloyDB instance where you want to use the extension. |
| `pg_freespacemap` | 1.2 | Examines the free space map (FSM). |
| `pg_hint_plan` | 1.4.2 (PostgreSQL 14) 1.5 (PostgreSQL 15) 1.6.0 (PostgreSQL 16) 1.7.0 (PostgreSQL 17) 1.8.0 (PostgreSQL 18) | Lets you improve PostgreSQL execution plans using hints, which are descriptions in SQL comments. > [!IMPORTANT] > **Important:** Before you can use `CREATE EXTENSION` to enable this extension, you must first [set the database flag](https://docs.cloud.google.com/alloydb/docs/instance-configure-database-flags.md.txt) `alloydb.enable_pg_hint_plan` to the value `on` in the AlloyDB instance where you want to use the extension. > Alternatively, you can connect to a database as a user that's a member > of the `alloydbsuperuser` role and use the command > `LOAD 'pg_hint_plan'` to load this extension for one > session. |
| `pg_ivm` | 1.11 | Provides support for materialized views. You can use materialized views to make incremental changes to the views instead of recomputing the contents from scratch. |
| `pg_partman` | 5.4.3 | Enables you to create and manage time-based and serial-based table partition sets. |
| `pg_prewarm` | 1.2 | Provides a convenient way to load relation data into either the operating system buffer cache or the PostgreSQL buffer cache. This extension is supported for manual prewarming by calling its functions directly. You can't enable or configure automatic prewarming features, because you can't configure the `shared_preload_libraries` or `pg_prewarm.autoprewarm` parameters in AlloyDB. |
| `pg_proctab` | 0.0.10 | Lets you use [pg_top](https://pg_top.gitlab.io/) with AlloyDB, and generate reports from the operating system process table. |
| `pg_repack` | 1.5.3 | Lets you remove bloat from tables and indexes. Optionally, it lets you perform an online CLUSTER to order tables by cluster index. |
| `pg_similarity` | 1.0 | Provides support for similarity queries on PostgreSQL. |
| `pg_squeeze` | 1.9 | Removes unused space from a table and optionally uses an index to sort records or rows (tuples) of the table. > [!IMPORTANT] > **Important:** Before you can use `CREATE EXTENSION` to enable this extension, you must first [set the database flag](https://docs.cloud.google.com/alloydb/docs/instance-configure-database-flags.md.txt) `alloydb.enable_pg_squeeze` to the value `on` in the AlloyDB instance where you want to use the extension. |
| `pg_stat_statements` | 1.10 | Provides a way to track execution statistics of all SQL statements executed. |
| `pg_textsearch` | 1.3 | Provides support for Best Matching 25 (BM25) scoring and indexing, enabling high-accuracy probabilistic ranking for full-text search. > [!NOTE] > **Note:** This extension is supported only on database instances running PostgreSQL 17 or higher. |
| `pg_trgm` | 1.6 | Provides functions and operators for determining the similarity of alphanumeric text based on trigram matching, as well as index operator classes that support fast searching for similar strings. |
| `pg_visibility` | 1.2 | Provides a way to examine the visibility map (VM) and the page-level visibility information of a table. |
| `pg_wait_sampling` | 1.1 | Collects sampling statistics of wait events. > [!IMPORTANT] > **Important:** Before you can use `CREATE EXTENSION` to enable this extension, you must first [set the database flag](https://docs.cloud.google.com/alloydb/docs/instance-configure-database-flags.md.txt) `alloydb.enable_pg_wait_sampling` to the value `on` in the AlloyDB instance where you want to use the extension. |
| `pgaudit` | 1.6.1 (PostgreSQL 14) 1.7 (PostgreSQL 15) 16.0 (PostgreSQL 16) 17.0 (PostgreSQL 17) 18.0 (PostgreSQL 18) | Provides detailed session and object audit logging using the standard logging facility provided by PostgreSQL. > [!IMPORTANT] > **Important:** Before you can use `CREATE EXTENSION` to enable this extension, you must first [set the database flag](https://docs.cloud.google.com/alloydb/docs/instance-configure-database-flags.md.txt) `alloydb.enable_pgaudit` to the value `on` in the AlloyDB instance where you want to use the extension. |
| `pgcrypto` | 1.3 | Provides cryptographic functions for PostgreSQL. |
| `pgfincore` | 1.4 | Provides a set of functions to manage pages in operating system disk cache memory from PostgreSQL. > [!NOTE] > **Note:** AlloyDB does not use operating system disk cache memory pages, so this extension offers no value when used with AlloyDB. |
| `pglogical` | 2.4.8 | Provides logical streaming replication for PostgreSQL using a publish/subscribe model. AlloyDB includes [a number of plugins](https://docs.cloud.google.com/alloydb/docs/reference/extensions.md.txt#logical-plugins) used by the `pglogical` extension. > [!IMPORTANT] > **Important:** Before you can use > `CREATE EXTENSION` to enable this extension, you must first > [set the database flags](https://docs.cloud.google.com/alloydb/docs/instance-configure-database-flags.md.txt) > `alloydb.enable_pglogical` and `alloydb.logical_decoding` > to the value `on` in the AlloyDB instance where > you want to use the extension. |
| `pgrowlocks` | 1.2 | Provides row locking information for the specified table. |
| `pgRouting` | 3.3.0 (PostgreSQL 14) 3.6.2 (PostgreSQL 15 and later) | Extends [`PostGIS`](https://docs.cloud.google.com/alloydb/docs/reference/extensions.md.txt#postgis), enabling geospatial processing through network routing and analysis. |
| `pgstattuple` | 1.5 | Provides various functions to obtain tuple-level statistics. |
| `pgtap` | 1.3.4 | Provides a unit testing framework for PostgreSQL, written in PL/pgSQL and PL/SQL. |
| `pgtt` | 4.6.0 | Adds support for global temporary tables to your databases. |
| `PostGIS` | 3.6.4 | Provides a spatial database extender for PostgreSQL. It adds support for geographic objects and lets you run location queries in SQL. PostGIS includes a number of further extensions which AlloyDB supports; see [PostGIS extensions](https://docs.cloud.google.com/alloydb/docs/reference/extensions.md.txt#postgis-extensions). |
| `prefix` | 1.2.0 | Provides prefix-matching, plus index support. |
| `rdkit` | 4.8.0 | Provides functions for comparing, manipulating, and identifying molecular structures. |
| `refint` | 1.0 | Includes functions to check foreign key constraints, the referencing table, and the referenced table. |
| `rum` | 1.3 | Implements support to create RUM indexes for high-performance full-text search. RUM indexes improve upon standard GIN indexes by storing positional information directly in the index, letting you perform faster phrase searches and relevance ranking without accessing the table data. |
| `sslinfo` | 1.2 | Provides information about the SSL certificate that the current client provided when it connected to the instance. |
| `tablefunc` | 1.0 | Provides various functions that return tables (multiple rows). |
| `tcn` | 1.0 | Provides a trigger function that notifies listeners of changes to the content of database tables. |
| `temporal_tables` | 1.2.2 | Provides support for temporal tables. In databases, a temporal table records the period of time for which a row is valid. |
| `tsm_system_rows` | 1.0 | Provides the table sampling method SYSTEM_ROWS, which can be used in the TABLESAMPLE clause of a SELECT command. |
| `tsm_system_time` | 1.0 | Provides the table sampling method SYSTEM_TIME, which can be used in the TABLESAMPLE clause of a SELECT command. |
| `unaccent` | 1.1 | Provides a text search dictionary that removes accents and other diacritical signs from lexemes. |
| `uuid-ossp` | 1.1 | Provides functions to generate universally unique identifiers (UUIDs) using one of several standard algorithms. |
| `vector` | 0.8.5.google-1 | The stock `pgvector` PostgreSQL extension is customized for AlloyDB, and referred to as `vector`. It lets you store vector embeddings, generate vector-optimized indexes, and perform nearest-neighbor search. |

## Logical decoding plugins

In addition to the extensions listed earlier on this page,
AlloyDB supports the following plugins used by the
[pglogical](https://docs.cloud.google.com/alloydb/docs/reference/extensions.md.txt#pglogical) extension for formatting that extension's streamed
output.

| Plugin | Description |
|---|---|
| `decoderbufs` | Formats streamed data as [protocol buffers](https://developers.google.com/protocol-buffers). |
| `pgoutput` | PostgreSQL's built-in logical decoding plugin. |
| `test-decoding` | Formats streamed data into a simple text format. |
| `wal2json` | Formats streamed data as JSON. |

## PostGIS extensions

AlloyDB's PostGIS support includes the following extensions:

- [`postgis`](http://www.postgis.net/)
- [`postgis_raster`](https://postgis.net/docs/RT_reference.html)
- [`postgis_sfcgal`](http://www.sfcgal.org/)
- [`postgis_tiger_geocoder`](http://postgis.net/docs/Geocode.html)
- [`postgis_topology`](http://postgis.net/docs/manual-dev/Topology.html)
- [`address_standardizer`](https://postgis.net/docs/manual-dev/Extras.html)
- [`address_standardizer_data_us`](https://postgis.net/docs/manual-dev/Extras.html)

## Enable an extension

Enable an extension by [connecting to a database](https://docs.cloud.google.com/alloydb/docs/connect-psql.md.txt) in
an AlloyDB
cluster's primary instance, then running a [`CREATE
EXTENSION`](https://www.postgresql.org/docs/current/sql-createextension.html)
command. For example, after connecting to your primary instance, you can enable
the `citext` extension using `psql`:

```sql
mydatabase=> CREATE EXTENSION IF NOT EXISTS citext;
```

Only database users who are members of the `alloydbsuperuser` role can run the
`CREATE EXTENSION` command. By default, this includes the `postgres` user.

> [!NOTE]
> **Note:** In AlloyDB, you don't need to configure the `shared_preload_libraries` database flag before enabling extensions. AlloyDB manages shared preload libraries automatically, and setting `shared_preload_libraries` directly isn't supported because it's a system-managed flag. For extensions that require explicit activation, such as pgAudit, set the corresponding AlloyDB flag on the instance, such as `alloydb.enable_pgaudit`.