# PostgreSQL developer explores AI effectiveness in SQL query generation

> **Key takeaway:** PostgreSQL core contributor Bruce Momjian presented research on how AI performs when writing SQL and how to optimize its effectiveness.

**Published:** 2026-11-04T17:00:00+00:00 
**Source:** Planet PostgreSQL 
**Category:** databases-storage 
**Canonical URL:** https://fosswire.org/news/postgresql-developer-explores-ai-effectiveness-in-sql-query-.html 

## Summary
PostgreSQL developer Bruce Momjian has delivered a new technical presentation at FOSS4G North America titled "Can AI Write SQL?". The presentation serves as a follow-up to his previous work regarding the construction of Model Context Protocol (MCP) servers using PostgreSQL.

The session specifically investigates the current capabilities of artificial intelligence in generating SQL queries. It also explores methodologies for improving the accuracy and effectiveness of AI-driven database interactions, addressing the growing intersection of large language models and relational database management systems.

## AI integration and SQL generation research
- **Research Focus:** The presentation evaluates the proficiency of AI models in translating natural language or intent into valid, optimized SQL queries.
- **Contextual Framework:** The work builds upon previous research into building Model Context Protocol (MCP) servers specifically designed to interface with PostgreSQL.
- **Optimization Strategies:** The study explores techniques to assist AI models in becoming more effective when interacting with database schemas.
- **Schema Metadata Utilization:** Related research suggests that utilizing database object comments can provide critical context to MCP clients, allowing them to better map user requests to specific schema objects.

## Why it matters
As AI-driven development tools and MCP clients become more prevalent, this research provides guidance for database administrators and engineers on how to structure schemas and metadata to support automated workflows. It highlights the importance of descriptive database comments for improving the reliability of AI-generated queries in production environments.