Page tree

Skip to end of metadata
Go to start of metadata
Product Name
Publisher Page
Relational Database Management Systems
TKU 2021-Feb-1
More Information
Publisher Link

Product Description

For TKU September 2020 Extended Discovery pattern was updated. Database Schema node type and Database Table node type were updated to contain DB Server type. (DRDC1-14748)

Extended Discovery pattern which allows to model Database Detail Nodes being managed by the PostgreSQL Server  is available for this product.

From TKU November 2017 onwards pattern will also discover Infobright Enterprise Edition. For more information, please visit Infobright Product Page .


Starting from TKU October 2018 modeling of SI key attribute has changed. Now SI key contains pg_data_path value.

Starting from TKU November 2018 PostgreSQL Database Server SI name attribute will contain bind_address and port values to be more unique.

PostgreSQL is a powerful, open source relational database system. It has more than 15 years of active development and a proven architecture that has earned it a strong reputation for reliability, data integrity, and correctness. It runs on all major operating systems, including Linux, UNIX (AIX, BSD, HP-UX, SGI IRIX, Mac OS X, Solaris, Tru64), and Windows. It is fully ACID compliant, has full support for foreign keys, joins, views, triggers, and stored procedures (in multiple languages). It includes most SQL92 and SQL99 data types, including INTEGER, NUMERIC, BOOLEAN, CHAR, VARCHAR, DATE, INTERVAL, and TIMESTAMP. It also supports storage of binary large objects, including pictures, sounds, or video. It has native programming interfaces for C/C++, Java, .Net, Perl, Python, Ruby, Tcl, ODBC, among others, and exceptional documentation.

Software Pattern Summary

Product ComponentOS TypeVersioningPattern Depth
DatabaseServerUNIXActive (command), File, Path, PackageInstance-based or grouped on command-line args (data dependent)
WindowsWMI Query, Active (command), File, Path, Package

Platforms Supported by the Pattern

The current pattern identifies an instance of PostgreSQL Server running on both Unix/Linux and Microsoft Windows platforms.


Software Instance Triggers

PatternTrigger NodeAttributeConditionArgument
DatabaseServerDiscoveredProcesscmdmatchesregex '\bpostmaster$'
cmdmatchesregex '\bpostgres$'
cmdmatchesregex '(?i)\bpg_ctl\.exe$'
cmdmatchesregex '(?i)\bpostgres\.exe'

Simple Identification Mappings

The following components/processes are identified using the combination of pattern definitions and simple identity mappings.

PostgreSQL Database Serverregex '\bpostmaster$'
EnterpriseDB Postgres Advanced Serverregex '\bedb\-postmaster$'
PostgreSQL Database Server Control processregex '(?i)\bpg_ctl\.exe$'
PostgreSQL Database Serverregex '\bpostgres:$'
EnterpriseDB Postgres Advanced Serverregex '\bedb\-postgres$'
PostgreSQL Database Serverregex '(?i)\bpostgres\.exe$'
PostgreSQL Scheduling Agentregex '(?i)\bpagent\.exe$'
Postgres Enterprise Managerregex '(?i)\bpem\.exe$'


Version information for the product is currently collected using one of three possible methods. We execute the methods in order based on their accuracy, depth and reliability. Once a result is obtained, the method lower in precedence is not attempted. In order of precedence the methods are

WMI Versioning (Windows Only)

On the Windows platform only, the pattern attempts to obtain version information by executing the following WMI query against the root\CIMV2 namespace:

  • SELECT Version FROM CIM_DataFile where Name='<trigger_process_cmd>'

Active Versioning - Command Execution

We have been able to identify one method to actively version this product. It provides a good level of reliability on both platforms and does not require special permissions.

Common Functionality

The first step for active versioning is to determine whether the path of the trigger process is an absolute path as only in that case will active versioning be attempted.

This is performed as follows:


  • regular expression used to match against the trigger process command: '^/'


  • regular expression used to match against the trigger process command: '^\w:'

Command Execution

The Unix specific version command is running postmaster command with the full path to it and "--version" parameter.
The Windows specific version command is running pg_ctl.exe command with the full path to it and "--version" parameter.

Executed Command:<abs_path_to_binary>/postmaster --versionUnix
Executed Command:<abs_path_to_binary>\pg_ctl.exe --versionWindows

The output is parsed using the following regular expression:






File Versioning

If we are unable to fetch the version from a previous versioning method we will attempt to read the PG_VERSION file in the <postgres_data_path> folder and parse its contents against the following regular expression:

  • (\d+(?:\.\d+)*)

Path Versioning

If we are unable to fetch the version from a previous versioning method we will attempt to parse the process's command line to see if we can identify any installation version from path using the following regular expression:

regex "/ppas\-(\d+(?:\.\d+)*)/"UNIX
regex '/PostgresPlus/(\d+(?:\.\d+)*)AS/'
regex '/edb/as(\d+(?:\.\d+)*)/'

regex '(?i)PostgreSQL\\(\d+(?:\.\d+)*)\\bin\\(?:pg_ctl|postgres)\.exe$' 

regex '(?i)\\PostgresPlus\\(\d+(?:\.\d+)*)AS\\'

This approach usually returns a version if path was not altered much during installation

Package Versioning

If the pattern is unable to extract the version from a previous versioning method then it will attempt to query the package management system to obtain the product version.
The pattern supplies the package query with a set of regular expressions to be checked for.

Regular ExpressionPlatform
(?i)^Postgres Plus Advanced ServerWindows

This usually returns a version if PostgreSQL was installed from package on Windows or Unix.

bind_address attribute

This attribute is first tried to be extracted from postgresql.conf file from "listen_addresses =" section.

If first approach failed or if listen_addresses is assigned to localhost or IP, then pattern tries to find target value by means of traverse to NetworkConnectionList on Discovery appliance. Port value is used for such traverse.

Application Model Produced by Software Pattern

Product Architecture

Following its startup, the PostgreSQL server will launch a number of worker processes which handle the various DB server functions

Software Pattern Model

The pattern triggers on postmaster or pg_ctl process (or edb-postmaster or edb-postgres in the case of an EnterpriseDB installation) since these processes shows that PostgreSQL is running.
The pattern then attempts to determine pg_data_path and the port the DB server is listening on and uses all these as part of the SI key If the key cannot be obtained, the pattern will create a grouped SI using the trigger process command-line arguments.
Finally, the pattern creates association links with processes related to the trigger process (child processes started by the main process)


The current Windows pattern trigger assumes that PostgreSQL is running as a service (expected in production environment)

Obtaining detailed PostgreSQL Database, Schema and Table information

A separate pattern has been created to query the PostgreSQL Server in order to obtain database list and (optionally) database table details. For more information about this pattern, please refer to the relevant page.

Subject Matter Expertise

Subject Matter Expert input will be welcome on any other potential approaches not discussed to improving product versioning coverage of PostgreSQL RDBMS especially with regard to EnterpriseDB installations.


Testing to ensure the processes related to PostgreSQL Database Server have been correctly identified and that the product can be versioned has been performed using Discovery record data as well as live discovery of hosts running Solaris, Linux and Windows operating systems.

Information Sources

Open Issues

There are no known open issues with this pattern.

Created by: Dmytro Ostapchuk 5 Nov 2008
Updated by: Dmytro Ostapchuk 17 Jan 2010
Reviewed by: Nikola Vukovljak 5 Nov 2008