# Postgres

<figure><img src="/files/OARRN7F8M9HfjQtVjCYI" alt="" width="292"><figcaption><p>Nodo Postgres</p></figcaption></figure>

Hay múltiples métodos para conectarse a Postgres según cómo esté configurada tu instancia. A continuación se muestra un ejemplo de una configuración local usando una imagen Docker precompilada proporcionada por el equipo de pgvector.

Crea un archivo llamado `docker-compose.yml` con el siguiente contenido:

```yaml
# Ejecuta este comando para iniciar la base de datos:
# docker-compose up --build
version: "3"
services:
  db:
    hostname: 127.0.0.1
    image: pgvector/pgvector:pg16
    ports:
      - 5432:5432
    restart: always
    environment:
      - POSTGRES_DB=api
      - POSTGRES_USER=myuser
      - POSTGRES_PASSWORD=ChangeMe
    volumes:
      - ./init.sql:/docker-entrypoint-initdb.d/init.sql
```

Usa `docker compose up` para iniciar el contenedor de Postgres.

Crea una nueva credencial con el usuario y contraseña configurados:

<figure><img src="/files/5UCVISOsA2KKtsA7N9ZL" alt="" width="526"><figcaption></figcaption></figure>

Completa los campos del nodo con los valores configurados en `docker-compose.yml`. Por ejemplo:

* Host: **localhost**
* Database: **api**
* Port: **5432**

¡Voilà! Ahora has configurado exitosamente Postgres Vector listo para ser usado.


---

# 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.flowiseai.com/espanol/documentacion-oficial/integraciones/langchain/vector-stores/postgres.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.
