---
sourceDocument: Australia IT Operations Management
sourceDocumentLink: https://www.servicenow.com/docs/r/it-operations-management

 Release :

    - australia

ft:locale :

    - en-US

ft:publication_title :

    - Australia IT Operations Management

ft:clusterId :

    - itom

bundleId :

    - itom

workflow :

    - Technology


---

# PostgreSQL

# PostgreSQL discovery {#ariaid-title1}

Release version: Australia  
Updated August 24, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 2 minutes to read
Summarize  
![AI sparkle icon](https://servicenow.com/docs/portal-asset/ai-sparkle-icon) Summarized using AI  
This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.  

## Summary of PostgreSQL discovery

PostgreSQL discovery in ServiceNow enables automated detection of running PostgreSQL instances on both Windows and Linux systems.
This capability helps populate the Configuration Management Database (CMDB) with detailed information about each PostgreSQL instance, supporting better infrastructure visibility and management.
Show full answer Show less  

## Credentials and Prerequisites

* **Credentials:** Create and configure PostgreSQL database credentials and optionally SSH credentials for secure access during discovery.
* **Root-level access:** The discovery user must have root-level access to retrieve the `postgresql.conf` file.
* **Privileged commands:** Ensure the MID Server user has elevated rights to execute privileged commands required for PostgreSQL discovery and Service Mapping on Unix-based hosts.

## Discovery Configuration

* Use classifiers, probes, and patterns to detect PostgreSQL instances:
  * Classifiers trigger probes to initiate discovery.
  * Key probes include horizontal pattern probes for PostgreSQL Instance, Configuration, and Version.
  * Patterns collect detailed data about instances, but some probes may be inactive by default for new instances and require activation.

## Data Collection and CMDB Population

Discovery collects and populates the following key PostgreSQL instance attributes into the `cmdbcidbpostgresqlinstance` table:

* **Name:** Default format is `instance@hostname`. Optionally, you can include the port number for clarity.
* **Data Directory:** Location of the PostgreSQL data files.
* **TCP Port(s):** The network port on which the instance listens.
* **Config File:** Path to `postgresql.conf`.
* **Version:** PostgreSQL software version.

## Distinguishing Multiple Instances on One Host

To differentiate multiple PostgreSQL instances running on the same host, create the `mid.discovery.postgresql.includeportinname` MID Server property (supported for UNIX hosts only). This property modifies the naming convention to include the port number (e.g., `instance-port@hostname`), preventing naming conflicts and improving CMDB accuracy.

## Relationships

Discovered PostgreSQL instances are related in the CMDB as running on either Windows Server or Linux Server CIs, enabling clear mapping of database instances to their underlying infrastructure.  
Discovery can find running instances of PostgreSQL on Windows and Linux systems.

## Credentials and other prerequisites {#r_DiscoverPostgreSQLInstances__section_ix5_ymk_mbb}

Create credentials for PostgreSQL discovery
:
    * [SSH credentials](https://www.servicenow.com/docs/access?context=r_SSHCredentialsForm&version=australia&pubname=australia-platform-security&ft:locale=en-US)
    * \[optional\] [Applicative credentials](https://www.servicenow.com/docs/access?context=applicative-creds&version=australia&pubname=australia-platform-security&ft:locale=en-US)

    {#r_DiscoverPostgreSQLInstances__ul_wvj_wkg_kcb}

Verify root-level access to the database
:   The user must have root-level access to the database to access the `postgresql.conf` file.

Verify privileged commands for for PostgreSQL discovery

:   For a list of privileged commands that you need for Discovery
    and Service Mapping, see [Service Mapping commands requiring a privileged user](https://www.servicenow.com/docs/fMLKP9ztw9H4ZPck4RnumQ "Service Mapping uses commands requiring elevated rights to discover and map Unix-based hosts in your organization. In addition to configuring necessary credentials, configure servers in your organization to allow Service Mapping to run these commands with elevated rights."). This list
    includes commands that require elevated rights to discover and map Unix-based hosts in
    your organization.

Differentiate multiple PostgreSQL instances on the same host by port number
:   Starting with Discovery and Service Mapping Patterns version 1.35.0, you can make multiple PostgreSQL instances on the same host distinguishable by port number by creating the
    mid.discovery.postgresql.include_port_in_name
MID Server property. For more information, see [Include the port number in PostgreSQL instance names](https://www.servicenow.com/docs/_RDpaA3O_1C_ife4si~Ahg "You can make multiple PostgreSQL instances on the same host distinguishable by port number by creating the mid.discovery.postgresql.include_port_in_name MID Server property. This property is supported for UNIX hosts only.").  
Note:  
For information on Probe to Pattern migration see the knowledge article [KB0694477](https://support.servicenow.com/kb_view.do?sysparm_article=KB0694477).

## Classifiers, patterns, and probes {#r_DiscoverPostgreSQLInstances__section_mcx_zmk_mbb}

{#r_DiscoverPostgreSQLInstances__table_fzd_2yv_jz__entry__3}

| Classifier | Trigger probes | Patterns |
|-|-|-|
| PostgreSQL Instance | * Horizontal Pattern: launches patterns * PostgreSQL - Configuration\* (add the must_sudo parameter to this probe) * PostgreSQL - Version\* {#r_DiscoverPostgreSQLInstances__ul_ixv_myv_jz} | PostgreSQL DB |
[ ]

{#r_DiscoverPostgreSQLInstances__table_fzd_2yv_jz}

\*For new instances, these probes are inactive on the classifier. Discovery uses patterns for discovery.

To use patterns, verify that the correct pattern is specified in the horizontal pattern probe on the classifier. See [Add the Horizontal Pattern probe to a classifier](https://www.servicenow.com/docs/WtfJx~H7mHHJKPMU3hBM9w#t_AddHorizontalPatternProbe "To use a pattern for the identification and exploration phases of horizontal discovery, add the Horizontal Pattern probe to the relevant classifiers. The classifiers must match the CI types you are trying to discover.") for instructions.

## Data collected

Discovery populates the data in the CMDB when running the PostgreSQL DB pattern.

The following fields gather specified information from the target. If the source is not configured, it brings back default information. For instance, for PostgreSQL Instance@hostname (default name), the source needs to be
modified. If not, all the "PostgreSQL Instance@hostname" will be added in the source for the PostgreSQL Instance \[cmdb_ci_db_postgresql_instance\] table.  
{#r_DiscoverPostgreSQLInstances__table_j5p_11t_3kc__entry__2}

| Field | Description |
|-|-|
| Name \[name\] | The display name of the PostgreSQL instance.\* |
| Data Directory \[data_dir\] | The data directory of the PostgreSQL instance, parsed from the process command line. |
| TCP port(s) \[tcp_port\] | The port on which the PostgreSQL instance is listening, determined from the running process. |
| Config File \[postgres_conf\] | The path to the `postgresql.conf` configuration file. |
| Version \[version\] | The PostgreSQL version, retrieved from the process executable. |
[Table 1. PostgreSQL Instance \[cmdb_ci_db_postgresql_instance\]]

{#r_DiscoverPostgreSQLInstances__table_j5p_11t_3kc}\* To populate the Name field in the format instance-port-tcp_port@hostname instead of the default instance@hostname, create the mid.discovery.postgresql.include_port_in_name MID Server property. For more information, see [Include the port number in PostgreSQL instance names](https://www.servicenow.com/docs/_RDpaA3O_1C_ife4si~Ahg "You can make multiple PostgreSQL instances on the same host distinguishable by port number by creating the mid.discovery.postgresql.include_port_in_name MID Server property. This property is supported for UNIX hosts only.").

## Relationships {#r_DiscoverPostgreSQLInstances__section_gyd_q4k_mbb}

{#r_DiscoverPostgreSQLInstances__table_hvy_q4k_mbb__entry__3}

| CI | Relationship | CI |
|-|-|-|
| PostgreSQL Instance \[cmdb_ci_db_postgresql_instance\] | Runs on::Runs | Windows Server \[cmdb_ci_windows_server\] or Linux Server \[cmdb_ci_linux_server\] |
[ ]

{#r_DiscoverPostgreSQLInstances__table_hvy_q4k_mbb}
* **[Include the port number in PostgreSQL instance names](https://www.servicenow.com/docs/_RDpaA3O_1C_ife4si~Ahg)**   
  You can make multiple PostgreSQL instances on the same host distinguishable by port number by creating the mid.discovery.postgresql.include_port_in_name MID Server property. This property is supported for UNIX hosts only.

