AI agents write PostgreSQL like Python
AI agents are being used to write PostgreSQL code, but they are introducing Python-like idioms that can be costly in terms of performance. The agents are using exception handling to signal ordinary outcomes, which can lead to significant performance issues. This can result in increased latency and decreased concurrency, making it a major concern for large-scale applications.
- ▪AI agents are writing PostgreSQL code with Python-like idioms, which can be costly in terms of performance.
- ▪The agents are using exception handling to signal ordinary outcomes, such as 'not found' or 'already processed'.
- ▪This can lead to significant performance issues, including increased latency and decreased concurrency.
Opening excerpt (first ~120 words) tap to expand
AI agents write PostgreSQL like Python#By Alexey EvlampievGive a coding agent a PostgreSQL-first backend to build and it will write you working SQL. It will also, with remarkable consistency, write you Python — Python’s exception-driven control flow, Python’s trust in casts, Python’s habit of validating wherever the code happens to be — transliterated into PL/pgSQL, where those idioms carry costs the agent never sees.This article is a field report. It draws on two internal reviews of a production line-of-business backend built database-first — a few hundred SQL files across roughly two dozen domains, with a kernel/handler split and a thin HTTP gateway — where AI coding agents wrote most of the SQL. The reviews rated every finding and verified each against the code before reporting it.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at pgmi.