﻿---
title: PostgreSQL database metricset
description: This is the database metricset of the PostgreSQL module. This is a default metricset. If the host module is unconfigured, this metricset is enabled by...
url: https://www.elastic.co/elastic/docs-builder/docs/2746/reference/beats/metricbeat/metricbeat-metricset-postgresql-database
products:
  - Beats
  - Metricbeat
applies_to:
  - Elastic Cloud Serverless: Generally available
  - Elastic Stack: Generally available
---

# PostgreSQL database metricset
This is the `database` metricset of the PostgreSQL module.
This is a default metricset. If the host module is unconfigured, this metricset is enabled by default.

## Fields

For a description of each field in the metricset, see the [exported fields](https://www.elastic.co/elastic/docs-builder/docs/2746/reference/beats/metricbeat/exported-fields-postgresql) section.
Here is an example document generated by this metricset:
```json
{
    "@timestamp": "2017-10-12T08:05:34.853Z",
    "event": {
        "dataset": "postgresql.database",
        "duration": 115000,
        "module": "postgresql"
    },
    "metricset": {
        "name": "database",
        "period": 10000
    },
    "postgresql": {
        "database": {
            "blocks": {
                "hit": 43969,
                "read": 381,
                "time": {
                    "read": {
                        "ms": 0
                    },
                    "write": {
                        "ms": 0
                    }
                }
            },
            "conflicts": 0,
            "deadlocks": 0,
            "name": "postgres",
            "number_of_backends": 2,
            "oid": 13395,
            "rows": {
                "deleted": 42,
                "fetched": 26418,
                "inserted": 98,
                "returned": 53201,
                "updated": 14
            },
            "stats_reset": "2021-03-05T18:39:18.089Z",
            "temporary": {
                "bytes": 0,
                "files": 0
            },
            "transactions": {
                "commit": 445,
                "rollback": 5
            }
        }
    },
    "service": {
        "address": "192.168.128.2:5432",
        "type": "postgresql"
    }
}
```