Configure PostgreSQL extensions

MySQL  |  PostgreSQL  |  SQL Server

You can extend PostgreSQL by bundling SQL objects into a package and using themas a unit. This page contains information about configuring the PostgreSQLextensions that Cloud SQL supports.

Use PostgreSQL extensions

You can install only the extensions that Cloud SQL supports. Formore information, seePostgreSQL extensions supported by Cloud SQL.

Note: You can only install extensions on the primary instance, not the readreplica. Once installed, the extension replicates to the read replica.

Install an extension

Before using an extension, install it:

Note: You must set flags before creating some extensions, such aspglogical. For more information, seeConfigure external replicas.

Requirement for superuser privileges

In Cloud SQL, extensions can only be created by users that are part of thecloudsqlsuperuser role. When you create a new PostgreSQL instance,the defaultpostgres user is created for you (although youmust set the user's password). The defaultpostgres user is part of thecloudsqlsuperuser role. For more information, seeAbout PostgreSQL users.

Note: If you import a database containing anextension that was created by a custom user, you can't delete that user withoutdeleting the entire imported database.

Inter-database connections

The target instances for connections must be in the same VPC network as theconnecting instance.

For cluster instances, you can't choose theRequire trusted client certificates option in theGoogle Cloud console.Additionally, to connect to databases within the same instance,you cannot set host tolocalhost or to127.0.0.1. Instead, you must use the IP addressshown for your instance in the Google Cloud console.

Request support for a new extension

You cannot create your own extensions in Cloud SQL.

To request support for an extension, click+1 on the open issue or create anew issue. For a list of open Cloud SQL issues and information aboutcreating new issues, seeSearch for or create issues and feature requests, by product.

PostgreSQL extensions supported by Cloud SQL

For information about using a specific extension, see the documentation link inone of the tables below.

Cloud SQL support for PostgreSQL extensions can be divided into thesecategories:

PostGIS

ThePostGIS extension is supportedfor Cloud SQL for PostgreSQL for all major versions.

The following table contains the PostGIS extension versions for eachCloud SQL for PostgreSQL version:

Cloud SQL for PostgreSQL versionPostGIS extension
PostgreSQL 9.63.2.5
PostgreSQL 103.2.5
PostgreSQL 113.2.5
PostgreSQL 123.4.4
PostgreSQL 133.5.2
PostgreSQL 143.5.2
PostgreSQL 153.5.2
PostgreSQL 163.5.2
PostgreSQL 173.5.2

For a specific PostgreSQL major version, in theCREATE EXTENSION command, you canspecify a PostGIS extension version by using theVERSION clause.

The PostGIS extension includes the following:

For more information, seePostGIS Installation.

Additionally, Cloud SQL for PostgreSQL includes version 3.6.2 of thepgRouting extension, which extends PostGIS.ThepgRouting extension enhances geospatial processing through network routingand analysis.

You can upgrade PostGISand its related extensions to their latest version manually.To learn more about upgrading your PostGIS extensions, seeUpgrading PostGIS.

Data type extensions

ExtensionDescription
btree_ginProvides sample GIN operator classes that implement B-tree equivalent behavior.
PostgreSQL 9.6 uses version 1.0. PostgreSQL 10 uses version 1.2. PostgreSQL 11 and later use version 1.3.
btree_gistProvides GiST index operator classes that implement B-tree equivalent behavior.
PostgreSQL 9.6 uses version 1.2. PostgreSQL 10, 11, 12, and 13 use version 1.5. PostgreSQL 14 uses version 1.6. PostgreSQL 15 and later use version 1.7.
chkpassImplements a data typechkpass that is designed for storing encrypted passwords.
PostgreSQL 9.6 and 10 use version 1.0. Not supported for other versions.
citextProvides a case-insensitive character string typecitext.
PostgreSQL 9.6 uses version 1.3. PostgreSQL 10 uses version 1.4. PostgreSQL 11 uses version 1.5. PostgreSQL 12 and later use version 1.6.
cubeImplements a data typecube for representing multidimensional cubes.
PostgreSQL 9.6 and 10 use version 1.2. PostgreSQL 11 uses version 1.3. PostgreSQL 12 and 13 use version 1.4. PostgreSQL 14 and later use version 1.5.
hstoreImplements thehstore data type for storing sets of key/value pairs within a single PostgreSQL value.
PostgreSQL 9.6 and 10 use version 1.4. PostgreSQL 11 uses version 1.5. PostgreSQL 12 uses version 1.6. PostgreSQL 13 uses version 1.7. PostgreSQL 14 and later use version 1.8.
ip4rProvides data types for IPv4/v6 addresses, and address ranges, plus index support.
Cloud SQL for PostgreSQL uses version 2.4.2.
isnProvides data types for some international product numbering standards.
PostgreSQL 9.6 and 10 use version 1.1. PostgreSQL 11 and later use version 1.2.
loSupport for managing Large Objects (also called LOs or BLOBs).
Cloud SQL for PostgreSQL uses version 1.1.
ltreeImplements a data typeltree for representing labels of data stored in a hierarchical tree-like structure.
PostgreSQL 9.6, 10, 11, and 12 use version 1.1. PostgreSQL 13, 14, 15, and 16 use version 1.2. PostgreSQL 17 uses version 1.3.
postgresql-hllIntroduces a new data type,hll, which is a HyperLogLog data structure. Also seepostgresql-hll in this document.
Cloud SQL for PostgreSQL uses version 2.18.
prefixProvides prefix-matching, plus index support.
Cloud SQL for PostgreSQL uses version 1.2.0.

Language extensions

ExtensionDescription
plpgsqlA loadable procedural language for creating functions, procedures and triggers. You also can use this language for direct execution of code in DO blocks.
Cloud SQL for PostgreSQL uses version 1.0.
plv8Provides a procedural language for enabling JavaScript.
Cloud SQL for PostgreSQL uses version 3.2.2, which in turn uses V8 JavaScript engine version 11.5.

Miscellaneous extensions

ExtensionDescription
amcheckProvides functions for verifying the logical consistency of the structure of relations, enabling the pg_amcheck application to check for corruption.
auto_explainEnables automatic logging of execution plans of slow statements, for troubleshooting and more. Provides an automated way to perform the functionality of the EXPLAIN command. Also seeauto_explain in this document.
autoincProvides functions for incrementing fields automatically. This trigger stores the next value of a sequence into an integer field.
Cloud SQL for PostgreSQL uses version 1.0.
bloomProvides a method to access indexes based on bloom filters. A bloom filter is a space-efficient data structure that you can use to test whether an element is a member of a set.
Cloud SQL for PostgreSQL uses version 1.0.
dblinkProvides functions to connect to PostgreSQL databases from within a database session. Also see dblink in this document.
Cloud SQL for PostgreSQL uses version 1.2.Note: If you'reusing Private Service Connect to connect to a Cloud SQL instance, then this extension can't be used with your instance.
decoderbufsA PostgreSQL logical decoder that delivers output data as Protocol Buffers, adapted for Debezium.
dict_intAn add-on dictionary template for full-text search that controls the indexing of integers.
Cloud SQL for PostgreSQL uses version 1.0.
earthdistanceProvides two approaches to calculating great circle distances on the surface of the Earth.
Cloud SQL for PostgreSQL uses version 1.1.
fuzzystrmatchProvides several functions to determine similarities and distance between strings.
PostgreSQL 9.6, 10, 11, 12, 13, 14 and 15 use version 1.1. PostgreSQL 16 and later use version 1.2
google_ml_integrationGenerates vector embeddings to translate text prompts into numerical vectors using a large language model (LLM).
PostgreSQL 12 and later use version 1.4.2. Not supported for other versions.
insert_usernameProvides functions for storing the current user's name into a text field. You can use this to track who last modified a row in a database table.
Cloud SQL for PostgreSQL uses version 1.0.
intaggProvides an integer aggregator and an enumerator.
Cloud SQL for PostgreSQL uses version 1.1.
intarrayProvides a set of functions and operators for manipulating null-free arrays of integers and performing indexed searches on them.
PostgreSQL 9.6, 10, 11, and 12 use version 1.2. PostgreSQL 13 uses version 1.3. PostgreSQL 14 and later use version 1.5.
moddatetimeProvides functions for storing the current time into atimestamp field. You can use this to track the last time that a row in a database table is modified.
Cloud SQL for PostgreSQL uses version 1.0.
oracle_fdwProvides a foreign data wrapper (fdw) for accessing Oracle databases easily and efficiently.
Cloud SQL for PostgreSQL uses version 1.2.
orafceProvides functions and operators that emulate a subset of functions and packages from an Oracle database. Use these functions to port Oracle applications to PostgreSQL.
PostgreSQL 9.6 and 10 use version 3.25. PostgreSQL 11 and later use version 4.13.
pageinspectInspects the contents of database pages at a low level. Also seepageinspect in this document.
PostgreSQL 9.6 uses version 1.5. PostgreSQL 10 uses version 1.6. PostgreSQL 11 and 12 use version 1.7. PostgreSQL 13 and 14 use version 1.8. PostgreSQL 15 uses version 1.11. PostgreSQL 16 and later use version 1.12.
pgAuditCollects audit data.

Possible values to set for the audit log files for all versions of pgAudit areREAD,WRITE,FUNCTION,ROLE,DDL,MISC, andALL. For versions 1.4.2 and above, you can also set the value ofMISC_SET.

For more information about using this extension with Cloud SQL, see Audit for PostgreSQL using pgAudit.

pg_backgroundLets you run arbitrary commands in a background worker.
Cloud SQL for PostgreSQL uses version 1.2.
pg_bigmEnables full-text search, and allows a two-gram (bigram) index for faster full-text search. Also seepg_bigm in this document.
pg_buffercacheProvides a means for examining what's happening in the shared buffer cache in real time.
PostgreSQL 9.6 uses version 1.2. PostgreSQL 10, 11, 12, 13, 14 and 15 use version 1.3. PostgreSQL 16 uses version 1.4. PostgreSQL 17 uses version 1.5.
pg_cronProvides a cron-based job scheduler. This extension enables cron syntax to schedule PostgreSQL commands directly from the database. For more information about the extension, seepg_cron in this document.
PostgreSQL versions 10 and later use version 1.6.4.
pgcryptoProvides cryptographic functions for PostgreSQL.
Cloud SQL for PostgreSQL uses version 1.3.
pglogicalProvides logical replication for PostgreSQL. See Setting up logical replication and decoding.
Cloud SQL for PostgreSQL uses version 2.4.5.Note: If you'reusing Private Service Connect to connect to a Cloud SQL instance, then this extension can't be used with your instance.
pgfincoreA set of functions to manage pages in operating system disk cache memory from PostgreSQL. Also seepgfincore in this document.
Cloud SQL for PostgreSQL uses version 1.3.1.
pg_freespacemapExamines the free space map (FSM). Also seepg_freespacemap in this document.
Cloud SQL for PostgreSQL uses version 1.2.
pg_hint_planEnables you to improve PostgreSQL execution plans using hints, which are simple descriptions in SQL comments. Also seepg_hint_plan in this document.
pgoutputThis plugin is used by logical replication for change data capture.pgoutput is a default plugin and is therefore supported on all versions of Cloud SQL for PostgreSQL.
pg_ivmEnables you to make materialized views up-to-date in which only incremental changes are computed and applied on views rather than recomputing the contents from scratch.
PostgreSQL versions 13 and later support version 1.9.Warning: Due to inherent limitations, this extension is incompatible with certain Cloud SQL for PostgreSQL operations: If users want to use any of these operations, they must first remove the extension, complete the operation, and then reapply the extension.
pg_partmanEnables you to create and manage time-based and serial-based table partition sets. Also seepg_partman in this document.
PostgreSQL versions 14 and later support version 5.2.4 while PostgreSQL versions that are earlier than 14 support only up to version 4.7.4.
pg_prewarmProvides a convenient way to load relation data into either the operating system buffer cache or the PostgreSQL buffer cache.
PostgreSQL 9.6 and 10 use version 1.1. PostgreSQL 11 and later use version 1.2.
pg_proctabEnables you to usepg_top with Cloud SQL for PostgreSQL, and generate reports from the operating system process table. Also seepg_proctab in this document.
pg_repackLets you remove bloat from tables and indexes. Optionally, lets you perform an online CLUSTER (order tables by cluster index). Also seepg_repack in this document.
Cloud SQL for PostgreSQL uses version 1.5.0.
pgrowlocksProvides row locking information for the specified table.
Cloud SQL for PostgreSQL uses version 1.2.
pgstattupleProvides various functions to obtain tuple-level statistics.
PostgreSQL 9.6 uses version 1.4. All other versions use version 1.5.
pg_similarityProvides support for similarity queries on PostgreSQL.
Cloud SQL for PostgreSQL uses version 1.0.
pg_squeezeRemoves unused space from a table and optionally uses an index to sort records or rows (tuples) of the table. For more information about this extension, seepg_squeeze in this document.
PostgreSQL versions 11 and later use version 1.5.
Note: PostgreSQL versions 16 and later don't support this extension.
pg_stat_statementsProvides a means for tracking execution statistics of all SQL statements executed.
PostgreSQL 9.6 uses version 1.4. PostgreSQL 10 and 11 use version 1.6. PostgreSQL 12 uses 1.7. PostgreSQL 13 uses 1.8. PostgreSQL 14 uses 1.9. PostgreSQL 15 and 16 use 1.10. PostgreSQL 17 uses 1.11.
pgTAPProvides a unit testing framework for PostgreSQL, written in PL/pgSQL and PL/SQL.
Cloud SQL for PostgreSQL uses version 1.3.0.
pg_trgmProvides 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.
PostgreSQL 9.6 and 10 use version 1.3. PostgreSQL 11 and 12 use version 1.4. PostgreSQL 13 uses 1.5. PostgreSQL 14 and later use version 1.6.
pgtt

Creates and manages DB2 or Oracle-style global temporary tables in a PostgreSQL database.
PostgreSQL 9.6, 10 and 11 use version 3.0. PostgreSQL 12 and later use version 4.0.

pgvector

An open-source extension for storing and searching vector embeddings in PostgreSQL databases.
PostgreSQL versions 13 and later support version 0.8.0, PostgreSQL version 12 supports up to version 0.7.4, and PostgreSQL version 11 supports up to version 0.5.1.

Note: The recommended TOAST storage mode for pgvector 0.6.0 with PostgreSQL version 12 isextended. For versions 13 and later, the storage mode isexternal for optimal performance. If you're using pgvector 0.6.0 with version 12, and then upgrade to a major version, we recommend that you modify the storage mode toexternal as follows:
ALTER TYPE vector SET (STORAGE = external);.

pg_visibilityProvides a way to examine the visibility map (VM) and the page-level visibility information of a table. Also seepg_visibility in this document.
Cloud SQL for PostgreSQL uses version 1.2.
pg_wait_samplingCollects sampling statistics of wait events, providing wait event data for processes on servers. Cloud SQL for PostgreSQL uses version 1.1.5.
PL/ProxyProcedural language handler that allows remote procedure calls among PostgreSQL databases, with optional sharding. Also seePL/Proxy in this document.
Cloud SQL for PostgreSQL uses version 2.11.0.Note: If you'reusing Private Service Connect to connect to a Cloud SQL instance, then this extension can't be used with your instance.
postgres_fdwAllows foreign data wrappers to be created within instances or across instances. Also seepostgres_fdw in this document.
PostgreSQL 9.6, 10, 11, 12, and 13 use version 1.0. PostgreSQL 14 and later use version 1.1.
Note: If you'reusing Private Service Connect to connect to a Cloud SQL instance, then this extension can't be used with your instance.
postgresql_anonymizer

Masks or replaces personally identifiable information (PII) or sensitive data from a PostgreSQL database. For more information, see thepostgresql_anonymizer section.

Cloud SQL for PostgreSQL uses version 1.0.0.

postgresql_hll

Provides a HyperLogLog (hll) data structure that estimates the cardinality of a set.

Cloud SQL for PostgreSQL uses version 2.18.

rdkitA collection of cheminformatics and machine-learning software. You can use this extension for comparing, manipulating, and identifying molecular structures.
Cloud SQL for PostgreSQL uses version 4.6.1.Note: RDKit extension can't be upgraded to version 4.6.1 from older versions on PostgreSQL 9.6, 10, 11, 12 and 13. It must be dropped and re-created for the upgrade.
refintIncludes functions to check foreign key restraints, the referencing table, and the referenced table. This extension also demonstrates the Server Programming Interface (SPI). Cloud SQL for PostgreSQL uses version 1.0.
sslinfoProvides information about the SSL certificate that the current client provided when it connected to the instance.
Cloud SQL for PostgreSQL uses version 1.2.
tablefuncIncludes various functions that return tables (multiple rows).
Cloud SQL for PostgreSQL uses version 1.0.
tcnProvides a trigger function that notifies listeners of changes to the content of database tables.
Cloud SQL for PostgreSQL uses version 1.0.
tds_fdwProvides a foreign data wrapper (fdw) for accessing databases, such as Microsoft SQL Server and Sybase, that use the Tabular Data Stream (TDS) protocol.Cloud SQL for PostgreSQL uses version 2.0.4.
temporal_tablesProvides support for temporal tables. A temporal table records the period of time when a row is valid from a database perspective.
Cloud SQL for PostgreSQL uses version 1.2.2.
tsm_system_rowsProvides the table sampling method SYSTEM_ROWS, which can be used in the TABLESAMPLE clause of a SELECT command.
Cloud SQL for PostgreSQL uses version 1.0.
tsm_system_timeProvides the table sampling method SYSTEM_TIME, which can be used in the TABLESAMPLE clause of a SELECT command.
Cloud SQL for PostgreSQL uses version 1.0.
unaccentA text search dictionary that removes accents (diacritic signs) from lexemes.
Cloud SQL for PostgreSQL uses version 1.1.
uuid-osspProvides functions to generate universally unique identifiers (UUIDs) using one of several standard algorithms.
Cloud SQL for PostgreSQL uses version 1.1.

More about some PostgreSQL extensions

This section describes more information about some of the supported PostgreSQLextensions in the tables above.

auto_explain

To begin using this extension on an instance, set thecloudsql.enable_auto_explain flag toon. For information about settingflags, and to review the flags supported for this extension, seeConfigure database flags.

To view logging data and events that are associated with the logs of the execution plans that this extension enables, see theCloud Logging documentation.

Alternatively, for a user that has thecloudsqlsuperuser role (only), you canuse theload command to load this extension for one session.

dblink

From within a database session, you can use this extension to connect toPostgreSQL databases and execute queries.

Currently, this extension works for two Cloud SQL private IP instances withinthe same VPC network, or for cross databases within the same instance.

Note: In Cloud SQL, the use of client certificates with dblink isn'tsupported.

For additional information, seedblink in the PostgreSQLdocumentation.

Use dblink to connect with a password

To connect to databases, or to connect to the same instance as anotheruser, you must specify a password. For example purposes(but not for production purposes), here is a code snippet:

SELECT*FROMdblink('dbname=name port=1234 host=host user=user password=password','select id, name from table'\)ASt(idint,nametext);

Alternatively, to only set up a connection, here is a code snippet for examplepurposes (not for production purposes):

SELECTdblink_connect('dbname=dblinktest user=postgres host=name_or_ip password=xxx');

Use dblink to connect without a password

To connect to the same instance as the same user, you can connect without apassword. For example:

  1. Set the following database flag to enable local connections without apassword
    cloudsql.allow_passwordless_local_connections

  2. Connect without specifying a host, which implies connecting to the sameinstance. Here is an example:

    SELECT*FROMdblink('dbname=finance user=alice','select income from revenue')ASrevenue(incomeinteger);

    The result could be similar to the following:

    income--------1000(1row)

To connect to databases within the same instance,you cannot set host to localhost or to127.0.0.1. Instead,you must use the IP address shown for your instance in the Google Cloud console.

Also seepostgres_fdw andPL/Proxy in thisdocument.

pageinspect

This extension inspects the contents of database pages at a low level.For more information, seepageinspectin the PostgreSQL documentation.

pg_bigm

This extension enables full-text search, and allows a two-gram (bigram) indexfor faster full-text search.

To begin using this extension on an instance, set thecloudsql.enable_pg_bigm flag toon. The following flags also are supported:

  • pg_bigm.enable_recheck
  • pg_bigm.gin_key_limit
  • pg_bigm.similarity_limit

For information about setting flags, and to review the flags supported for thisextension, seeConfigure database flags.

pg_cron

To begin usingpg_cron on aninstance, set thecloudsql.enable_pg_cron flag toon. For information aboutsetting flags, and to review the flags supported for this extension, seeConfigure database flags.

The jobs are configured as background workers, so you might need touse standard PostgreSQL techniques(such as themax_worker_processes flag) to adjust the number ofthose background workers.

For this extension, Cloud SQL supports the background worker mode, but notthe libpq interface. Therefore, trust authentication directlyinvolving this extension is not required.

pgfincore

This extension contains functions for managing pages in operating system diskcache memory from PostgreSQL. For more information, see thepgfincore documentation.

pg_freespacemap

This extension examines the free space map (FSM). For more information, seepg_freespacemap in thePostgreSQL documentation.

pg_hint_plan

To begin using this extension on an instance, set thecloudsql.enable_pg_hint_plan flag toon. For information about settingflags, and to review the flags supported for this extension, seeConfigure database flags.

Alternatively, for only a user with thecloudsqlsuperuser role, you canuse theload command to load this extension for one session.

pg_partman

This extension enables you to create and manage time-based and serial-basedtable partition sets.

In Cloud SQL, this extension doesn't include the background worker for automaticpartition maintenance. Instead, you can use, for example,Cloud Scheduler to drive maintenanceby callingmaintenance functionsat a regular interval.

pg_proctab

Here are the steps to use thepg_proctab extensionto enable thepg_top utility:

  1. In the psql tool, run theCREATE EXTENSION command forpg_proctab.
  2. Download and runpg_top.
  3. When connecting to a Cloud SQL for PostgreSQL instance, add the-r option for connecting to a remote database, for gettingmetrics.

The following instance-wide metrics, which are included in the output, includeusage by other supporting agents and services in the instance:

  • Load average
  • CPU states (% user, nice, system, idle, and iowait)
  • Memory (used, free, and cached)

pg_repack

This extension enables you to remove bloat from tables and indexes. Optionally,you can use this extension to perform an online CLUSTER (order tables by clusterindex). For more information, see thepg_repack documentation. Additionally, foruse of this extension in Cloud SQL, a special procedure is needed foradding privileges to a user.

If a user outside of thecloudsqlsuperuser role wants to use an extension,you must grant the usercloudsqlsuperuser privileges. For more information, inthis document, seeRequirement for superuser privileges.The following example uses theGRANT command to add the necessary privileges.

Example of adding privileges

For example purposes below,csuper1 is acloudsqlsuperuser andtestdb is adatabase owned bytestuser. To create the pg_repack extension intestdb,initially run the following commands:

  1. Connect totestdb as thecloudsqlsuperuser:

    psql-Ucsuper1-dtestdb;
  2. Grant the database owner, which istestuser, tocsuper1:

    GRANTtestuserTOcsuper1;
  3. Create the extension:

    CREATEEXTENSIONpg_repack;
  4. Run thepg_repack command on a table, such ast1 intestdb, ascsuper1:

    pg_repack-h<hostname>-dtestdb-Ucsuper1-k-tt1
  5. After the pg_repack job is completed, revoke the grant that you performed in step 2:

    REVOKEtestuserFROMcsuper1;

Thepg_repack command might fail with the following error:
"ERROR: query failed: SSL SYSCALL error: EOF detected"

If that error occurs, try setting TCP keepalives to a smaller value and then runthepg_repack command. For more information, seeConnections timeout (from Compute Engine).

pg_squeeze

This extension removes unused space from a table and optionally uses an index to sort tuples of the table. To begin using the extension on an instance, set thecloudsql.enable_pg_squeeze flag toon.

This extension also supports logical decoding by writing additional information to the write-ahead log (WAL). To enable this functionality for the extension, set thewal_level configuration parameter tological or higher by setting thecloudsql.logical_decoding flag toon.

The extension requires a value to be set for themax_replication_slots flag. If you haven't specified a value for this flag, then set the value to1. Otherwise, add 1 to the value that's set for the flag.

For information about setting flags, and to review the flags supported for this extension, seeConfigure database flags.

pgtt

To begin using this extension on an instance, set thepgtt.enabled flag toon. For information about settingflags, and to review the flags supported for this extension, seeConfiguring database flags.

pg_visibility

This extension provides a way to examine the visibility map (VM) andthe page-level visibility information of a table. For more information, seepg_visibility in thePostgreSQL documentation.

PL/Proxy

This extension is a procedural language handler that allows remote procedurecalls among PostgreSQL databases, with optional sharding.

For more information, see thePL/Proxy documentation.

The target instances for connections must be in the same VPC network as theconnecting instance. Additionally, you cannot choose, in theGoogle Cloud console, theAllow only SSL connections button forcluster instances.

To connect to databases within the same instance,you cannot set host to localhost or to127.0.0.1. Instead,you must use the IP address shown for your instance in the Google Cloud console.

Also seepostgres_fdw anddblink in this document.

postgresql_anonymizer

To begin using this extension on an instance, set thecloudsql.enable_anon flag toon. For information about settingflags, and to review the flags supported for this extension, seeConfiguring database flags.

postgres_fdw

This extension allows tables from other ("foreign") PostgreSQL databasesto be exposed as "foreign" tables in the current database. Those tables then areavailable for use, almost as if they were local tables. For more information,seepostgres_fdw in thePostgreSQL documentation.

This extension works for two Cloud SQL private IP instances within thesame VPC network, or for cross databases within the same instance.

To connect to databases within the same instance, you cannot set host tolocalhost or to127.0.0.1. Instead, you must use the IP addressshown for your instance in the Google Cloud console.

Additionally, for an instance where foreign data is stored,you can choose theAllow only SSL connections option in the Google Cloud console.You can't choose theRequire trusted client certificates option.Only thecloudsqlsuperuser can be the ownerof apostgres_fdw foreign data wrapper.

Also seePL/Proxy anddblink in this document.

postgresql-hll

This extension introduces a new data type,hll, which is a HyperLogLog datastructure. For more information, see thepostgresql-hll documentation.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-07-14 UTC.