Skip to main content

PostgreSQL

This plugin discovers databases and tables from PostgreSQL instances.

Status: experimental

Example Configuration


host: "localhost"
port: 5432
user: "postgres"
password: "mysecretpassword"
ssl_mode: "disable"
include_databases: true
include_columns: true
include_row_counts: true
discover_foreign_keys: true
exclude_system_schemas: true
schema_filter:
include:
- "^public$"
- "^app_.*"
exclude:
- "^test_.*"
table_filter:
include:
- ".*"
exclude:
- "^temp_.*"
database_filter:
include:
- ".*"
exclude:
- "^template.*"
tags:
- "postgres"
- "database"

Configuration

The following configuration options are available:

PropertyTypeRequiredDescription
hoststringfalsePostgreSQL server hostname or IP address
portintfalsePostgreSQL server port (default: 5432)
userstringfalseUsername for authentication
passwordstringfalsePassword for authentication
ssl_modestringfalseSSL mode (disable, require, verify-ca, verify-full)
include_databasesboolfalseWhether to discover databases
include_columnsboolfalseWhether to include column information in table metadata
include_row_countsboolfalseWhether to include approximate row counts (requires analyze)
discover_foreign_keysboolfalseWhether to discover foreign key relationships
schema_filterplugin.FilterfalseFilter configuration for schemas
table_filterplugin.FilterfalseFilter configuration for tables
database_filterplugin.FilterfalseFilter configuration for databases
exclude_system_schemasboolfalseWhether to exclude system schemas (pg_*)

Available Metadata

The following metadata fields are available:

FieldTypeDescription
allow_connectionsboolWhether connections to this database are allowed
collatestringDatabase collation
column_defaultstringDefault value expression
column_namestringColumn name
commentstringColumn comment/description
commentstringObject comment/description
connection_limitintMaximum allowed connections
constraint_namestringForeign key constraint name
createdstringCreation timestamp
ctypestringDatabase character classification
data_typestringData type
databasestringDatabase name
encodingstringDatabase encoding
hoststringPostgreSQL server hostname
is_nullableboolWhether null values are allowed
is_primary_keyboolWhether column is part of primary key
is_templateboolWhether database is a template
object_typestringObject type (table, view, materialized_view)
ownerstringObject owner
portintPostgreSQL server port
row_countint64Approximate row count
schemastringSchema name
sizeint64Object size in bytes
source_columnstringColumn in the referencing table
source_schemastringSchema of the referencing table
source_tablestringName of the referencing table
table_namestringObject name
target_columnstringColumn in the referenced table
target_schemastringSchema of the referenced table
target_tablestringName of the referenced table