Skip to content

PostgreSQL Tools Documentation

This document lists all available Postgres tools and their usage.

Tools

Tool Name Description Parameters
postgresql_execute_database_query Execute SQL queries against a PostgreSQL database - connection_id (string): The ID of the PostgreSQL connection to use
- sql_query (string): The SQL query to execute
postgresql_list_database_connections List all available PostgreSQL connections None

Configuration

Required Parameters

Before connecting to PostgreSQL, you'll need to gather the following information:

  1. PostgreSQL Host - The server address where your PostgreSQL database is running (e.g., localhost or db.example.com)
  2. PostgreSQL Port - The port number PostgreSQL is listening on (default is 5432)
  3. PostgreSQL Database - The name of the database you want to connect to
  4. PostgreSQL Username - Your database user account
  5. PostgreSQL Password - Your database user password
  6. PostgreSQL Schema (optional) - The specific schema you want to use (defaults to public if not specified)

Connection String Format

The standard PostgreSQL connection string format is:

postgresql://<username>:<password>@<host>:<port>/<database>

Example:

postgresql://myuser:mypassword@localhost:5432/mydatabase

Troubleshooting

If you encounter connection issues:

  1. Check if the PostgreSQL server is running
  2. Verify your credentials are correct
  3. Ensure the database exists and is accessible
  4. Check network connectivity to the host and port
  5. Verify your IP is allowed in PostgreSQL's access control lists (pg_hba.conf)

For additional help or specific error messages, consult the PostgreSQL documentation.