Related ToolsAmazon Q DeveloperCursorClaude CodeChatgpt

PgAdmin 4 v9.13 Adds an AI Assistant for Writing SQL Queries

AI news: PgAdmin 4 v9.13 Adds an AI Assistant for Writing SQL Queries

For years, writing SQL in PgAdmin meant either knowing the syntax cold or keeping a reference tab open. Version 9.13 adds a third option: just describe what you want in English.

The new AI Assistant Panel sits inside PgAdmin's Query Tool as a chat-style sidebar. You type something like "show me all orders from the last 30 days grouped by customer" and it generates the SQL, syntax-highlighted and ready to use. Three buttons let you insert the result at your cursor position, replace everything in the editor, or copy it to the clipboard.

How It Works

The assistant maintains conversation context, so you can iterate. Ask for a query, then follow up with "add a filter for orders over $100" and it refines the previous output. It handles SELECT, INSERT, UPDATE, DELETE, and DDL statements (the commands that create or modify database tables and structures).

Setup requires configuring an AI provider under Preferences. PgAdmin's documentation does not specify which providers are supported, but the configuration-based approach suggests it works with major API providers rather than being locked to one vendor.

Practical Limits

PgAdmin's own docs include a clear warning: review all generated queries before running them. That is good advice for any AI-generated SQL, especially for UPDATE and DELETE statements that modify data. The AI does not know your specific data constraints or business rules, so treat its output as a strong first draft, not a finished product.

This is a meaningful addition to PgAdmin, which is the most widely used open-source administration tool for PostgreSQL. Database admins and developers who already live in PgAdmin now get AI query generation without switching to a separate tool or paying for a dedicated AI SQL product. The fact that you bring your own AI provider also means no additional subscription cost beyond what you already pay for API access.