# PostgreSQL

The `pgsql` output plugin allows to send data from Fluent Bit to a PostgreSQL Database Server 9.4 or above. To store the data we use the JSON type so make sure that your PostgreSQL instance supports this type.

## Configuration Parameters

| Key            | Description                       | Default      |
| -------------- | --------------------------------- | ------------ |
| Host           | Hostname of PostgreSQL instance   | 127.0.0.1    |
| Port           | PostgreSQL port                   | 5432         |
| Database       | Database name to connect          | fluentbit    |
| Table          | Table name where to store data    | fluentbit    |
| User           | PostgreSQL username               | current user |
| Password       | Password of PostgreSLQ username   |              |
| Timestamp\_Key | Key to store the record timestamp | date         |

## Configuration Example

In your main configuration file add the following section:

```
[OUTPUT]
    Name          pgsql
    Match         *
    Host          172.17.0.2
    Port          5432
    Database      fluentbit
    Table         fluentbit
    User          postgres
    Password      YourCrazySecurePassword
    Timestamp_Key timestamp
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fluentbit.io/manual/1.4/pipeline/outputs/postgresql.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
