# PostgreSQL

DoubleLoop allows you to populate your metrics in DoubleLoop with time-series data from PostgreSQL. Here's how to do it.

1. Get your PostgreSQL Host, Port, Database Name, Username, and Password ready, or ask your IT team for assistance in getting this information for your PostgreSQL instance.

   <mark style="color:red;">**Important**</mark><mark style="color:red;">: You will need to make sure the PostgreSQL instance is reachable over the internet.</mark>
2. In DoubleLoop, double-click on a metric on the map.
3. Click the "Source" tab in the right drawer.
4. Choose "PostgreSQL" as the source.
5. Fill in your Host with either the domain name or IP address of your PostgreSQL instance.
6. Fill in the Port with your port, the default for PostgreSQL is 5432.
7. Fill in your PostgreSQL database name, username, and password.
8. Input the query into DoubleLoop. The output of the query must contain columns named "date" and "value". We recommend that you test out the query in PostgreSQL before you input it into DoubleLoop.
9. Click "Save".

If you get stuck, please reach out!

![](/files/e1CmfAQL9Exjcyx9wcVk)


---

# 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.doubleloop.app/measure/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.
