# Contrib Modules

> Changes to contrib extensions and the modules covered by the source document.

---

LLMS index: [llms.txt](/en/llms.txt)

---

<div class="feature-source-note"><span class="feature-edition-badge">GA</span><span><strong>Source pages:</strong> PDF 90-106</span><span><a href="https://github.com/nori-shinoda/documents/blob/1773200c5362476c4a549222b7d17fa91f546cae/postgresql18_ga_new_features_en_20260219-1.pdf">Original PDF on GitHub</a></span></div>

<p class="feature-page-marker" id="pgfeat-18-modules-pdf-page-90">PDF page 90</p>

Describes new features related to the Contrib modules.

#### 3.5.1 Amcheck {#pg18-3-5-1-amcheck}

The function gin_index_check, which checks the GIN index, has been added. [[14ffaec](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=14ffaece0fb53fed8ddbc46d2b353e1c4834863a)]

**Example 117.** Checking the GIN index

```text
postgres=# CREATE INDEX idx1_gin1 ON gin1 USING GIN
(to_tsvector('english', title1)) ;
CREATE INDEX
postgres=# SELECT gin_index_check('idx1_gin1') ;
 gin_index_check
-----------------
(1 row)
```

#### 3.5.2 Bloom {#pg18-3-5-2-bloom}

Bloom index usage is now stored in the pg_stat_*_index view. [[93063e2](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=93063e2e429b03e8b06295ede0f0ebb5199b656a)]

<p class="feature-page-marker" id="pgfeat-18-modules-pdf-page-91">PDF page 91</p>

**Example 118.** Bloom Index Usage

```text
postgres=> CREATE INDEX idx1_bloom ON data1 USING bloom (col1) ;
CREATE INDEX
postgres=> EXPLAIN ANALYZE SELECT * FROM data1 WHERE col1=10000 ;
                                 QUERY PLAN
------------------------------------------------------------------------------
 Bitmap Heap Scan on data1  (cost=15348.00..15352.01 rows=1 width=10) …
   Recheck Cond: (col1 = 10000)
   Rows Removed by Index Recheck: 350
   Heap Blocks: exact=341
   ->  Bitmap Index Scan on idx1_bloom  (cost=0.00..15348.00 rows=1 width=0)…
         Index Cond: (col1 = 10000)
 Planning Time: 0.101 ms
 Execution Time: 3.602 ms
(8 rows)
postgres=> SELECT indexrelname, idx_scan, idx_tup_read FROM
 pg_stat_user_indexes ;
 indexrelname | idx_scan | idx_tup_read
--------------+----------+--------------
 idx1_bloom   |        1 |          351
(1 row)
```

#### 3.5.3 Dblink {#pg18-3-5-3-dblink}

The option use_scram_passthrough has been added to the foreign data wrapper dblink_fdw to pass through SCRAM authentication. [[3642df2](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=3642df265d09779443a9f44f5cb873df40974e89)]

**Example 119.** Pass\-through of SCRAM authentication credentials

```text
postgres=# CREATE SERVER link1 FOREIGN DATA WRAPPER dblink_fdw OPTIONS
(host 'dbsvr1', port '5432', dbname 'demodb', use_scram_passthrough 'true') ;
CREATE SERVER
```

<p class="feature-page-marker" id="pgfeat-18-modules-pdf-page-92">PDF page 92</p>

#### 3.5.4 File_fdw {#pg18-3-5-4-file-fdw}

The following options have been added. These options can have the same values as the options in the COPY statement. [[a1c4c8a](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=a1c4c8a9e1e3a53996dafa1f4ee6d4f7de2c58b2), [6c8f670](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=6c8f670323d22acb62104f7f8f1b1a078dadd255)]

**Table 29.** Added options

| Option name | Description |
| --- | --- |
| on_error | Determines the action to be taken when a minor error occurs. The possible values are as follows<br>• default: Stop execution (default value)<br>• ignore: Continue execution of the process |
| log_verbosity | This parameter determines the level of log output. The following values can be specified<br>• default: Output the number of errors (default value)<br>• verbose: Output more detailed logs<br>• silent: No log output |
| reject_limit | Specifies the number of data type conversion error records to allow, with the on_error=ignore option |

<p class="feature-page-marker" id="pgfeat-18-modules-pdf-page-93">PDF page 93</p>

**Example 120.** Additional options for file\_fdw module \(option on\_error \= \&\#x27\;ignore\&\#x27\;\)

```text
postgres=# \! cat /tmp/fs1.csv
100,data1
ABC,data2
300,data3
postgres=# CREATE EXTENSION file_fdw ;
CREATE EXTENSION
postgres=# CREATE SERVER fs FOREIGN DATA WRAPPER file_fdw ;
CREATE SERVER
postgres=# CREATE FOREIGN TABLE fs1 (id INT, val TEXT) SERVER fs
OPTIONS (filename '/tmp/fs1.csv', FORMAT 'csv',
ON_ERROR 'ignore', REJECT_LIMIT '1') ;
CREATE FOREIGN TABLE
postgres=# SELECT * FROM fs1 ;
NOTICE:  1 row was skipped due to data type incompatibility
 id  |  val
-----+-------
 100 | data1
 300 | data3
(2 rows)
```

**Example 121.** Additional options for file\_fdw module \(option log\_verbosity \= ‘verbose’\)

```text
postgres=# CREATE FOREIGN TABLE fs2 (id INT, val TEXT) SERVER fs
  OPTIONS (filename '/tmp/fs1.csv', FORMAT 'csv', ON_ERROR 'ignore',
REJECT_LIMIT '1', LOG_VERBOSITY 'verbose') ;
CREATE FOREIGN TABLE
postgres=# SELECT * FROM fs2 ;
NOTICE:  skipping row due to data type incompatibility at line 2 for column
"id": "ABC"
NOTICE:  1 row was skipped due to data type incompatibility
 id  |  val
-----+-------
 100 | data1
 300 | data3
(2 rows)
```

<p class="feature-page-marker" id="pgfeat-18-modules-pdf-page-94">PDF page 94</p>

#### 3.5.5 Injection_points {#pg18-3-5-5-injection-points}

The following new features have been added to the injection_points module

##### Additional custom parameter {#pg18-p94-additional-custom-parameter}

The parameter injection_points.stats has been added. This parameter determines whether cumulative statistics are enabled in the module. By default, statistics are disabled (off). [[2e35c67](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=2e35c67f956891b2dd7c30fbac9a14e76377300a)]

##### Add callbacks {#pg18-p94-add-callbacks}

The callback to initialize the shared memory of the module specified in the shared_preload_libraries parameter has been added. [[b2b023a](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=b2b023aa3706ec6b3978708545301f7436205c6d)]

#### 3.5.6 Isn {#pg18-3-5-6-isn}

The isn.weak parameter has been added to the isn module. Previous versions used the isn_weak function, which has been retained for compatibility but is now set to VOLATILE. [[4489044](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=44890442398cf3a65230d53167e61905d2b0d348)]

#### 3.5.7 Passwordcheck {#pg18-3-5-7-passwordcheck}

The parameter passwordcheck.min_password_length, which indicates the minimum password length, has been added to the passwordcheck module. The default value for this parameter is 8. [[f7e1b38](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=f7e1b3828a930639aefb5746a214cb5ddf734361)]

**Example 122.** Minimum password length setting

```text
postgres=# SET passwordcheck.min_password_length = 12 ;
SET
postgres=# ALTER ROLE demo PASSWORD 'ABCDEFGHIJK' ;
ERROR:  password is too short
DETAIL:  password must be at least "passwordcheck.min_password_length" (12)
bytes long
```

<p class="feature-page-marker" id="pgfeat-18-modules-pdf-page-95">PDF page 95</p>

#### 3.5.8 Pgcrypto {#pg18-3-5-8-pgcrypto}

The following enhancements have been added to the pgcrypto module

##### Addition of the fips_mode function {#pg18-p95-addition-of-the-fips-mode-function}

The fips_mode function has been added to indicate whether OpenSSL has FIPS enabled. [[924d89a](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=924d89a354750976cdd271d1dfc6c1e97cbb8851)]

#### Syntax 19 - Fips_mode function {#pg18-syntax-19}

```sql
boolean fips_mode()
```

**Example 123.** Execution of the fips\_mode function

```text
postgres=> SELECT fips_mode() ;
 fips_mode
-----------
 f
(1 row)
```

##### Control of built-in crypto functions {#pg18-p95-control-of-built-in-crypto-functions}

When OpenSSL is used in FIPS mode, cryptographic implementations that are not FIPS certified should not be used. The parameter pgcrypto.built-in_crypto_enabled has been added to disable builtin functions for this purpose. Only SUPERUSER can change this parameter. [[035f99c](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=035f99cbebe5ffcaf52f8370394446cd59621ab7)]

**Example 124.** Disable built\-in functions

```text
postgres=# SET pgcrypto.builtin_crypto_enabled = off ;
SET
postgres=# SELECT gen_salt('des') ;
ERROR:  use of built-in crypto functions is disabled
postgres=# SELECT crypt('data1', 'salt1') ;
ERROR:  use of built-in crypto functions is disabled
```

##### CFB Mode Added to AES Encryption Functions {#pg18-p95-cfb-mode-added-to-aes-encryption-functions}

CFB (Cipher-FeedBack mode) has been added to the AES encryption mode. [[9ad1b3d](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=9ad1b3d01f369f1b204324857e58d9283ff0a527)]

<p class="feature-page-marker" id="pgfeat-18-modules-pdf-page-96">PDF page 96</p>

**Example 125.** Added CFB mode

```text
postgres=> SELECT encrypt('foo', '0123456789', 'aes-cfb') ;
 encrypt
----------
 \x6f8ced
(1 row)
postgres=> SELECT encode(decrypt(encrypt('foo', '0123456', 'aes-cfb'),
'0123456', 'aes-cfb'), 'escape') ;
 encode
--------
 foo
(1 row)
```

##### SHA-2-based hashing and encryption {#pg18-p96-sha-2-based-hashing-and-encryption}

```text
  SHA-2 based hash algorithms sha256crypt and sha512crypt are now available. [749a9e2]
```

<p class="feature-page-marker" id="pgfeat-18-modules-pdf-page-97">PDF page 97</p>

**Example 126.** SHA\-256 \/ SHA\-512 hashing and encryption

```text
postgres=> SELECT gen_salt('sha256crypt') ;
            gen_salt
---------------------------------
 $5$rounds=5000$yTxNtev7NxPXhErT
(1 row)
postgres=> SELECT gen_salt('sha512crypt') ;
            gen_salt
---------------------------------
 $6$rounds=5000$NoKe0.dTtV9RHhBN
(1 row)
postgres=> SELECT crypt('test', gen_salt('sha512crypt')) ;
                                                         crypt
---------------------------------------------------------------------------…
$6$rounds=5000$B6qwrNDTAV6Zq5ZX$D8mfxoa3IO2BUjZWG4fMCs52wcb9wLigkDwfA4ZZ6CE3yW
Mwy5sIZ0xLCZI/dctvxQP9Grx7sk.ooQu5GI7hf1
(1 row)
```

#### 3.5.9 Pg_buffercacahe {#pg18-3-5-9-pg-buffercacahe}

The following new features have been added to the pg_buffercache module

##### Added the pg_buffercache_numa view {#pg18-p97-added-the-pg-buffercache-numa-view}

New view pg_buffercache_numa with the following columns has been added. [[ba2a3c2](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=ba2a3c2302f1248496322eba917b17a421499388)]

**Table 30.** Column structure of the pg\_buffercache\_numa view

| Column name | Data type | Description |
| --- | --- | --- |
| bufferid | integer | Buffer ID |
| os_page_num | bigint | OS page number |
| numa_node | integer | NUMA node number |

##### Added functions {#pg18-p97-added-functions}

The following functions have been added. [[dcf7e16](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=dcf7e1697ba75ce7883ad7c6bc26ba24422eb892)]

<p class="feature-page-marker" id="pgfeat-18-modules-pdf-page-98">PDF page 98</p>

**Table 31.** Added functions

| Function name | Description |
| --- | --- |
| pg_buffercache_evict_relation | Remove specific table information from buffer cache |
| pg_buffercache_evict_all | Remove all information from buffer cache |

**Example 127.** Execution of the pg\_buffercache\_evict\_relation function

```text
postgres=# SELECT * FROM pg_buffercache_evict_relation('data1') ;
 buffers_evicted | buffers_flushed | buffers_skipped
-----------------+-----------------+-----------------
            5410 |            5406 |               0
(1 row)
```

#### 3.5.10 Pg_logicalinspect {#pg18-3-5-10-pg-logicalinspect}

The pg_logicalinspect module has been added to PostgreSQL 18. This contrib module provides functions to inspect logical decoding components. The added function specifies a snapshot file of the logical decoding. [[7cdfeee](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=7cdfeee320e72162b62dddddee638e713c2b8680)]

#### Syntax 20 - Pg_get_logical_snapshot / Pg_get_logical_snapshot_info functions {#pg18-syntax-20}

```sql
record pg_get_logical_snapshot_meta(filename text)
record pg_get_logical_snapshot_info(filename text)
```

**Example 128.** Execution of the pg\_get\_logical\_snapshot\_meta function

```text
postgres=# SELECT * FROM pg_get_logical_snapshot_meta('0-57004740.snap') ;
-[ RECORD 1 ]--------
magic    | 1369563137
checksum | 1831531145
version  | 6
```

<p class="feature-page-marker" id="pgfeat-18-modules-pdf-page-99">PDF page 99</p>

**Example 129.** Execution of the pg\_get\_logical\_snapshot\_info function

```text
 postgres=# SELECT * FROM pg_get_logical_snapshot_info('0-57004740.snap') ;
-[ RECORD 1 ]------------+-----------
state                    | consistent
xmin                     | 767
xmax                     | 766
start_decoding_at        | 0/570043B8
two_phase_at             | 0/0
initial_xmin_horizon     | 0
building_full_snapshot   | f
in_slot_creation         | f
last_serialized_snapshot | 0/57004708
next_phase_at            | 0
committed_count          | 0
committed_xip            |
catchange_count          | 0
catchange_xip
```

#### 3.5.11 Pg_overexplain {#pg18-3-5-11-pg-overexplain}

The pg_overexplain module has been added to PostgreSQL 18. When loaded, this module allows the addition of the DEBUG option to the EXPLAIN statement, which can be used to debug the output of an EXPLAIN statement. [[8d5ceb1](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=8d5ceb113e3f7ddb627bd40b26438a9d2fa05512), [9f0c36a](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=9f0c36aea0fba7d2b737964d34ed582edf644283)]

<p class="feature-page-marker" id="pgfeat-18-modules-pdf-page-100">PDF page 100</p>

**Example 130.** Execution of the EXPLAIN \(DEBUG\) statement

```text
postgres=# LOAD 'pg_overexplain' ;
LOAD
postgres=# EXPLAIN (DEBUG) SELECT * FROM data1 WHERE col1=1000 ;
                               QUERY PLAN
-------------------------------------------------------------------------
 Index Scan using data1_pkey on data1  (cost=0.42..8.44 rows=1 width=10)
   Index Cond: (col1 = 1000)
   Disabled Nodes: 0
   Parallel Safe: true
   Plan Node ID: 0
 PlannedStmt:
   Command Type: select
   Flags: canSetTag
   Subplans Needing Rewind: none
   Relation OIDs: 16389
   Executor Parameter Types: none
   Parse Location: 16 for 33 bytes
(12 rows)
```

#### 3.5.12 Pg_stat_statements {#pg18-3-5-12-pg-stat-statements}

The following features have been added to the pg_stat_statements module.

##### Retrieving Internal SQL {#pg18-p100-retrieving-internal-sql}

The query ID can now also be calculated for internal SQL statements used for CREATE TABLE AS and DECLARE CURSOR statements. This allows the execution time of internal SQL to be retrieved in environments where the pg_stat_statements.track option is set to 'all'. [[6b652e6](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=6b652e6ce85a977e4ca7b8cc045cf4f3457b2d7b)]

<p class="feature-page-marker" id="pgfeat-18-modules-pdf-page-101">PDF page 101</p>

**Example 131.** Capture internal SQL statements

```text
postgres=> SHOW pg_stat_statements.track ;
 pg_stat_statements.track
--------------------------
 all
(1 row)
postgres=> CREATE TABLE data2 AS SELECT * FROM data1 WHERE col1=1000 ;
SELECT 1
postgres=>  SELECT queryid, toplevel, query FROM pg_stat_statements WHERE query
LIKE '%data2%' ;
       queryid        | toplevel |                     query
----------------------+----------+--------------------------------------------
  3120039891713996032 | f        | CREATE TABLE data6 AS SELECT * FROM …
 -9061638578758616641 | t        | CREATE TABLE data6 AS SELECT * FROM …
(2 rows)
```

##### SET Statements as Constants {#pg18-p101-set-statements-as-constants}

The SET statement settings are stored as constants with parameter symbols in the pg_stat_statements table. Previously, statements with different specified values were stored separately. If the constants DEFAULT or FROM CURRENT are used, they are not subject to constant conversion. [[dc68515](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=dc68515968e80d75f8106d0df05da346be537628)]

**Example 132.** SET statement constant

```text
postgres=> SET work_mem = '8MB' ;
SET
postgres=> SET work_mem = '16MB' ;
SET
postgres=> SET work_mem = DEFAULT ;
SET
postgres=> SELECT query, calls FROM pg_stat_statements WHERE query LIKE 'SET%' ;
         query          | calls
------------------------+-------
 SET work_mem = DEFAULT |     1
 SET work_mem = $1      |     2
(2 rows)
```

<p class="feature-page-marker" id="pgfeat-18-modules-pdf-page-102">PDF page 102</p>

##### Additional Columns {#pg18-p102-additional-columns}

The following columns have been added to the pg_stat_statements view. The columns added are parallel query execution information and the number of times the WAL buffer was full. [[cf54a2c](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=cf54a2c002544a4b7934deb44c895750aadb0a3c), [ce5bcc4](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=ce5bcc4a9f26484746f82d23584c8e342cba9b10)]

**Table 32.** Added columns

| Column name | Data type | Description |
| --- | --- | --- |
| parallel_workers_to_launch | bigint | Number of parallel workers scheduled to execute |
| parallel_workers_launched | bigint | Number of parallel workers executed |
| wal_buffers_full | bigint | Number of times the WAL buffer has been full |

**Example 133.** Verify additional columns \(parallel query information\)

```text
postgres=> SELECT COUNT(*) FROM data1 ;
-[ RECORD 1 ]--
count | 1000000
postgres=> SELECT query, parallel_workers_to_launch, parallel_workers_launched
FROM pg_stat_statements WHERE userid=16384 ;
-[ RECORD 1 ]--------------+---------------------------
query                      | SELECT COUNT(*) FROM data1
parallel_workers_to_launch | 4
parallel_workers_launched  | 4
```

##### Compression of Constant Lists {#pg18-p102-compression-of-constant-lists}

When the number of IN lists in a WHERE clause is variable, previous versions allocated separate Query IDs. PostgreSQL 18 compresses the constant list and assigns a single Query ID. [[62d712e](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=62d712ecfd940f60e68bde5b6972b6859937c412), [9fbd53d](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=9fbd53dea5d513a78ca04834101ca1aa73b63e59)] For example, execute the following SQL statement and check it in the pg_stat_statements view.

**Example 134.** SQL statements to execute

```sql
SELECT * FROM data1 WHERE col1 IN (10, 20) ;
SELECT * FROM data1 WHERE col1 IN (10, 20, 30, 40, 50) ;
```

<p class="feature-page-marker" id="pgfeat-18-modules-pdf-page-103">PDF page 103</p>

**Example 135.** PostgreSQL 17 behavior

```text
postgres=> SELECT calls, query FROM pg_stat_statements WHERE query LIKE
'%data1%' ;
 calls |                          query
-------+----------------------------------------------------------
     1 | SELECT * FROM data1 WHERE col1 IN ($1, $2)
     1 | SELECT * FROM data1 WHERE col1 IN ($1, $2, $3)
(2 rows)
```

**Example 136.** PostgreSQL 18 behavior

```text
postgres=> SELECT calls, query FROM pg_stat_statements WHERE query LIKE
'%data1%' ;
 calls |                      query
-------+---------------------------------------------------
     2 | SELECT * FROM data1 WHERE col1 IN ($1 /*, ... */)
(1 row)
```

#### 3.5.13 Pgstattuple / pageinspect {#pg18-3-5-13-pgstattuple-pageinspect}

Each function in the Contrib module now also supports sequences. [[05036a3](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=05036a3155c1e8d21500b5ecbbc2f8fbeb4aea66)]

**Example 137.** Pageinspect module

```text
postgres=# CREATE EXTENSION pageinspect ;
CREATE EXTENSION
postgres=# SELECT tuple_data_split('seq1'::regclass, t_data, t_infomask,
t_infomask2, t_bits) FROM heap_page_items(get_raw_page('seq1', 0)) ;
-[ RECORD 1 ]----+------------------------------------------------------
tuple_data_split | {"\\x0100000000000000","\\x0000000000000000","\\x00"}
```

<p class="feature-page-marker" id="pgfeat-18-modules-pdf-page-104">PDF page 104</p>

**Example 138.** Pgstattuple module

```text
postgres=# CREATE SEQUENCE seq1 ;
CREATE SEQUENCE
postgres=# CREATE EXTENSION pgstattuple ;
CREATE EXTENSION
postgres=# SELECT * FROM pgstattuple('seq1') ;
-[ RECORD 1 ]------+------
table_len          | 8192
tuple_count        | 1
tuple_len          | 41
tuple_percent      | 0.5
dead_tuple_count   | 0
dead_tuple_len     | 0
dead_tuple_percent | 0
free_space         | 8108
free_percent       | 98.97
```

#### 3.5.14 Postgres_fdw {#pg18-3-5-14-postgres-fdw}

The following features have been added to the postgres_fdw module.

##### SCRAM Authentication Pass-through {#pg18-p104-scram-authentication-pass-through}

The option USE_SCRAM_PASSThrough has been added to perform authentication by automatically sending SCRAM authentication information. This option can be specified as an attribute of SERVER or USER MAPPING. [[761c795](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=761c79508e7fbc33c1b11754bdde4bd03ce9cbb3)]

**Example 139.** Pass\-through settings for SCRAM authentication

```text
postgres=# CREATE SERVER remsvr1 FOREIGN DATA WRAPPER postgres_fdw
OPTIONS (host 'dbsvr1', port '5432', dbname 'postgres') ;
CREATE SERVER
postgres=# CREATE USER MAPPING FOR demo SERVER remsvr1
OPTIONS (user 'demo', use_scram_passthrough 'true') ;
CREATE USER MAPPING
```

<p class="feature-page-marker" id="pgfeat-18-modules-pdf-page-105">PDF page 105</p>

##### Enhancements to the postgres_fdw_get_connections function {#pg18-p105-enhancements-to-the-postgres-fdw-get-connections-function}

The used_in_xact and closed columns have been added to the return value of the postgres_fdw_get_connections function. Also, a check_conn parameter (default false) has been added to the function's parameters to check for connections. [[c297a47](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=c297a47c5f8da78d976e8c3f790dbeeb6a21a853), [857df3c](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=857df3cef7be93f7b9214c926e7af6f06a8cf23e), [4f08ab5](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=4f08ab55457751308ffd8d33e82155758cd0e304)]

**Table 33.** Added return column

| Column name | Data type | Description |
| --- | --- | --- |
| user_name | text | Connection mapping username (or public) |
| used_in_xact | boolean | Is a transaction in progress? |
| closed | boolean | Is the session closed? |

**Example 140.** Execution of the postgres\_fdw\_get\_connections function

```text
postgres=> BEGIN ;
BEGIN
postgres=*> INSERT INTO data1 VALUES (100, 'data1') ;
INSERT 0 1
postgres=*> SELECT * FROM postgres_fdw_get_connections(true) ;
 server_name | user_name | valid | used_in_xact | closed | remote_backend_pid
-------------+-----------+-------+--------------+--------+--------------------
 remsvr1     | public    | t     | t            | f      |             309160
(1 row)
postgres=*> COMMIT ;
COMMIT
postgres=> SELECT * FROM postgres_fdw_get_connections(true) ;
 server_name | user_name | valid | used_in_xact | closed | remote_backend_pid
-------------+-----------+-------+--------------+--------+--------------------
 remsvr1     | public    | t     | f            | f      |             309160
(1 row)
```

##### Function postgres_fdw_get_connections {#pg18-p105-function-postgres-fdw-get-connections}

The remote_backend_pid column (type int4), which indicates the backend process ID of the remote server, has been added to the return value of the postgres_fdw_get_connections function. [[fe186bd](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=fe186bda78c4a0ccbb691489c744e6317f648434)]

<p class="feature-page-marker" id="pgfeat-18-modules-pdf-page-106">PDF page 106</p>

**Example 141.** Execution of the postgres\_fdw\_get\_connections function

```text
postgres=> CREATE FOREIGN TABLE data1(col1 INT, col2 VARCHAR(10))
SERVER remsvr1 ;
CREATE FOREIGN TABLE
postgres=> SELECT * FROM data1 ;
 col1 | col2
------+------
(0 rows)
postgres=> SELECT * FROM postgres_fdw_get_connections() ;
 server_name | user_name | valid | used_in_xact | closed | remote_backend_pid
-------------+-----------+-------+--------------+--------+--------------------
 remsvr1     | demo      | t     | f            |        |             370760
(1 row)
```

#### 3.5.15 Miscellaneous {#pg18-3-5-15-miscellaneous}

In addition to those described above, the following test extension modules have been added under the src/test/modules directory. [[93bc3d7](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=93bc3d75d8e1aabdc256ff6da2282266dca82537), [b3f0be7](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=b3f0be788afc17d2206e1ae1c731d8aeda1f2f59), [b85a9d0](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=b85a9d046efdd27775cbe7db9e92aad96aab4ada)]

**Table 34.** Added modules

| Module name | Description |
| --- | --- |
| oauth_validator | OAUTHBeare/SASL Validator |
| test_aio | Asynchronous I/O Testing |
| typecache | Type cache Testing |
