Urgent.News

What's breaking now, across thousands of outlets.

AI

5 Things AI Cannot Do at PostgreSQL

AI has become surprisingly good at PostgreSQL. Give it a schema and it can write a query in seconds. Paste an EXPLAIN ANALYZE result into a chat and it may suggest an index or point to an expensive join. That is useful. But there is a difference between writing PostgreSQL code and understanding why the database should work that way . After looking at the practical side of PostgreSQL, five gaps…

PostgreSQL and AI have a surprisingly strong relationship. It can quickly generate queries when given a schema, suggest indexes or optimization strategies when shown EXPLAIN ANALYZE results, and identify potential performance issues in production environments. However, there are several significant limitations to what AI can accomplish in PostgreSQL:

1. Lack of understanding of business logic: AI may generate valid SQL, but it cannot comprehend the nuances of your specific application's business rules. This can lead to queries that work technically but produce incorrect results based on the application's unique requirements.

2. Difficulty in making architectural trade-offs: PostgreSQL offers numerous configuration options to optimize performance. However, deciding which trade-offs are acceptable requires human judgment. For example, adding indexes can improve query speed but also increase storage requirements and maintenance overhead. The decision depends on the specific workload and constraints of the system.

3. Inability to reliably diagnose production issues: When a database becomes slow or unresponsive, pinning down the root cause can be complex. AI can help by analyzing logs and query plans, but identifying the true cause often requires piecing together multiple clues that may not be immediately apparent. Factors like MVCC, isolation levels, locks, and application behavior can interact in subtle ways that require expert knowledge to interpret.

4. Security decisions are beyond AI's purview: While AI can assist with writing policies and identifying overly permissive permissions, security decisions extend beyond SQL alone. Factors such as risk tolerance, internal policies, auditing requirements, and legal obligations all come into play. AI can suggest controls, but ultimately humans must determine what level of risk is acceptable and how to handle failures appropriately.

5. Lack of ability to invent novel solutions: AI excels at combining existing knowledge to provide practical solutions. However, for novel or highly unusual scenarios where no established best practice exists, AI cannot generate an original answer. Instead, it requires human expertise to experiment, iterate, and find the optimal approach through a process of hypothesis, testing, and adjustment.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in AI

More from Wednesday 16 September →