Skip to Content
Unified docs shell with shared Classifyre tokens and acid-green highlight accents.
SourcesPostgre SQL

Postgre SQL

Schema-driven source documentation.

POSTGRESQL39 fields3 examples
Commonly Asked Questions
Assistant knowledge mapped to this source type from assistant_knowledge.json.

Required
Fields required for a valid configuration payload under `config.required`.
PathTypeRequiredDescriptionDefaultConstraints
requiredobjectYesno extra properties
required.hoststringYesPostgreSQL hostlocalhost
required.portintegerYesPostgreSQL port5432min 1, max 65535
Masked
Sensitive fields under `config.masked` (secrets/credentials).
PathTypeRequiredDescriptionDefaultConstraints
maskedobjectYesno extra properties
masked.passwordstringYesDatabase password
masked.usernamestringYesDatabase username
Optional
Optional configuration fields under `config.optional`.
PathTypeRequiredDescriptionDefaultConstraints
optionalobjectNono extra properties
optional.connectionobjectNoConnection tuning and SSL behavior.no extra properties
optional.connection.connect_timeout_secondsintegerNoConnection timeout in seconds10min 1, max 120
optional.connection.ssl_modeenumNoSSL mode for PostgreSQL connection Allowed values: disable, allow, prefer, require, verify-ca, verify-fullprefer
optional.scopeobjectNoDatabase, schema, and table selection scope.no extra properties
optional.scope.databasestringNoSingle database to scan (optional when include_all_databases is true)
optional.scope.exclude_schemasarrayNoSchema denylist (exact schema names)["information_schema","pg_catalog","pg_toast"]
optional.scope.exclude_schemas[]stringNo
optional.scope.include_all_databasesbooleanNoScan all non-template databases visible to this userfalse
optional.scope.include_schemasarrayNoOptional schema allowlist (exact schema names)
optional.scope.include_schemas[]stringNo
optional.scope.include_tablesarrayNoOptional table allowlist. Accepted forms: schema.table or database.schema.table
optional.scope.include_tables[]stringNo
optional.scope.maintenance_databasestringNoDatabase used for database enumeration when include_all_databases is truepostgres
optional.scope.table_limitintegerNoOptional cap on number of table assets extractedmin 1
Examples
Reference payloads generated from shared source examples JSON.
Scan a single PostgreSQL database with random row sampling
Extract table assets from one database and sample random rows for detector content

Schedule

{
  "enabled": true,
  "preset": "weekday_business",
  "cron": "33 14 * * 1-5",
  "timezone": "UTC"
}

Config Payload

{
  "type": "POSTGRESQL",
  "required": {
    "host": "localhost",
    "port": 5432
  },
  "masked": {
    "username": "postgres",
    "password": "test"
  },
  "optional": {
    "scope": {
      "database": "postgres"
    }
  },
  "sampling": {
    "strategy": "RANDOM",
    "limit": 20,
    "max_columns": 20,
    "max_cell_chars": 512
  }
}
Scan all databases with latest-row sampling
Enumerate all visible databases and prioritize latest records when sampling detector payloads

Schedule

{
  "enabled": true,
  "preset": "nightly",
  "cron": "56 0 * * *",
  "timezone": "UTC"
}

Config Payload

{
  "type": "POSTGRESQL",
  "required": {
    "host": "localhost",
    "port": 5432
  },
  "masked": {
    "username": "postgres",
    "password": "test"
  },
  "optional": {
    "scope": {
      "include_all_databases": true,
      "maintenance_database": "app"
    }
  },
  "sampling": {
    "strategy": "LATEST",
    "limit": 30,
    "order_by_column": "updated_at",
    "fallback_to_random": true
  }
}
Scan selected schemas with detector pipeline
Limit extraction scope to business schemas and run secrets + PII detectors on sampled rows

Schedule

{
  "enabled": true,
  "preset": "weekday_morning",
  "cron": "22 7 * * 1-5",
  "timezone": "UTC"
}

Config Payload

{
  "type": "POSTGRESQL",
  "required": {
    "host": "localhost",
    "port": 5432
  },
  "masked": {
    "username": "postgres",
    "password": "test"
  },
  "optional": {
    "scope": {
      "database": "postgres",
      "include_schemas": [
        "public",
        "analytics"
      ],
      "exclude_schemas": [
        "information_schema",
        "pg_catalog",
        "pg_toast"
      ]
    }
  },
  "sampling": {
    "strategy": "RANDOM",
    "limit": 15,
    "max_total_chars": 15000
  },
  "detectors": [
    {
      "type": "SECRETS",
      "enabled": true
    },
    {
      "type": "PII",
      "enabled": true
    }
  ]
}