PostgreSQL
Connect to PostgreSQL database to retrieve and manage data.
Key Features
- SQL query execution
- Database schema retrieval
- Table and data management
- Advanced data type support
- Real-time data analysis
- Read-only mode support
Basic Information
Authentication Method
Authenticates using username/password.
Input Parameters
- Host (required): PostgreSQL server host
- Port (required): PostgreSQL server port (default: 5432)
- Database (optional): Database name to connect to (default: postgres)
- Username (required): PostgreSQL username
- Password (required): PostgreSQL password
- Connection Timeout (optional): Connection timeout duration (default: 30000ms, max: 60000ms)
- Use SSL (optional): Whether to use SSL connection
- Read Only (optional): Whether to enable read-only mode
Supported MCP Tools
execute_sql
Executes SQL queries on PostgreSQL database and returns results.
In read-only mode, only the following SQL commands are allowed:
SELECT
- Data retrievalWITH
- Common Table Expression usageEXPLAIN
- Query execution plan retrievalANALYZE
- Query analysisSHOW
- Metadata retrieval
Result Limitation: Returns maximum 500 rows for performance reasons.
For example,
- When you input “Retrieve data from the users table” as a prompt,
- The LLM executes the
SELECT * FROM users
query through MCP. - Then, it responds in the chat based on the tool call results.
PostgreSQL Connection Setup Method
- Prepare a user account that can access the PostgreSQL server.
- Grant necessary database permissions.
- Configure network access permissions.
- Select PostgreSQL integration in QueryPie AI.
- Enter connection information to complete the setup.
Notes
- Keep PostgreSQL user account passwords secure.
- It’s recommended to grant only the minimum necessary database permissions.
- It’s recommended to use SSL connections in production environments.
- Large query results are limited to 500 rows, so use appropriate LIMIT clauses.
- Enable read-only mode to prevent data modifications.
Last updated on