评论称 pgrust 测试发现多个 PostgreSQL 缺陷
一篇评论文章称,Michael Malis 的 pgrust 项目在测试中发现了多个 PostgreSQL 缺陷:可导致有效 SP-GiST 操作失败的数值问题、可产生错误 JSONPath 结果的格式缓存问题、可导致后续操作失败的 pgcrypto 问题、字典加载器中的多个内存安全问题,以及一个溢出问题。评论者表示,pgrust 并非没有缺陷,但项目进行了大量测试,其主要卖点仍是性能优化。
该评论将 pgrust 的大量测试与多个具体 PostgreSQL 缺陷的发现联系起来,提供了一个由 PostgreSQL 核心开发之外的测试识别数据库缺陷的实例。
“We should be more ambitious with the software we build”
Since early this year, Michael Malis (of pgrust) has been showing me interesting things he's done and saying
[W]e should be more ambitious1 with the software we build
There is, understandably, a lot of skepticism about projects like pgrust because there are so many low-quality AI-generated projects out there. If I didn't know Malis and didn't look into it, I would just assume that pgrust was another vibe slopped project that's never going to work. But I know Malis well enough to trust his work without looking into it, and if you look into it a bit, you'll see that in testing pgrust, he's testing thoroughly enough that he's even uncovering real bugs in Postgres, such as this numerical bug that can cause valid SP-GiST operations to fail, this format cache bug that can cause incorrect results from JSONPath, this pgcrypto bug that can cause later operations to fail, multiple memory safety bugs in the dictionary loader2, this money overflow bug, etc.
This isn't to say that pgrust is bug free3, but it does indicate that there's a substantial amount of testing happening and, even if pgrust itself is never successful, just making the attempt will have improved Postgres in a durable way. The main pitch for pgrust is actually performance, and that's where the really interesting work is happening; if pgrust fails, it's possible that some of the optimizations they've demonstrated will make it into Postgres, Clickhouse, etc., but that's obviously less direct than filing Postgres bugs which get fixed.