Live data from Hacker News

Postgres rewritten in Rust, now passing 100% of the Postgres regression tests

github.com

381–390 of 756 posts

Re: Postgres rewritten in Rust, now passing 100% of the Postgres regression tests

#381
post #374

Earlier quoted context omitted.

If it's a choice between performance and being able to "safely" run sketchy extensions, I'd rather have performance.

What about extensions that are not sketchy? Lots of good ones out there.

Presumably they'd be fine running in a threaded context.

Re: Postgres rewritten in Rust, now passing 100% of the Postgres regression tests

#382
post #339

Earlier quoted context omitted.

With programs large enough tests aren't going to ever be enough. Formal verification might work, but then who checks the specification for bugs?

In the case of rewrites, the specification is the original behavior, no? bugs and all.

There is often no spec, just the old code, copied with the old bugs and with new ones sprinkled on top.

Re: Postgres rewritten in Rust, now passing 100% of the Postgres regression tests

#383
post #262

Hey author here. Wasn't expecting to see this up. To concisely give an overview of the project, I've been experimenting with using LLMs to build a better version of Postgres. Postgres is 30 years old and we've learned a lot about databases since hten. A lot of the techniques that work for doing a rewrite are also useful for doing a rearchitecture. I'm now working on a new, not yet published version of pgrust that inc…

A thread per connection is a almost always the correct decision for performance, but by choosing a process per connection, postgres is able to let you load whatever sketchy extensions you want. Worst case you crash the process, not the database. It would be nice if you could strike a balance so a segfaul in the extension only crashes a small percentage of connections, not the whole thing.

[deleted]

Re: Postgres rewritten in Rust, now passing 100% of the Postgres regression tests

#384

Earlier quoted context omitted.

If it's a choice between performance and being able to "safely" run sketchy extensions, I'd rather have performance.

In the age of vibe-generated code, I promise you're gonna want the safety.

So load them up in read replicas

Re: Postgres rewritten in Rust, now passing 100% of the Postgres regression tests

#385

Earlier quoted context omitted.

It's the notably poor quality of LLM-generated code

As opposed to the incredible code that humans are known to write...

If attention is all we need then what is better

Hours of human attention

or a few seconds of AI attention?

I am not just talking about writing the code but the brainstorming that goes into it.

Re: Postgres rewritten in Rust, now passing 100% of the Postgres regression tests

#386
post #362
post #283

Earlier quoted context omitted.

The PostgreSQL License is a variant of the BSD license and is therefore compatible with the (A)GPL. Comprehend it this way: You create a blank (A)GPL project and incorporate the upstream BSD codebase into it. While those original upstream files remain under their original permissive license, the project as a whole is governed by the (A)GPL (plus the attribution requirements of the upstream license, which the GPL perm…

Yes, BSD licenses are compatible with AGPL meaning BSD licensed code can be combined with AGPL licensed code while complying with both licenses. However, it does not give you permission to relicense the BSD code (or derivative works) as AGPL. The author is free to license any new code they write as AGPL, however the license for the machine translated code is another question. If it is considered a derivative work (wh…

IANAL, but calling this "relicensing" is technically inaccurate. It is more precise to describe it as adding constraints. When you combine your work with upstream code, you are layering additional requirements (like copyleft) onto the existing attribution requirements. The original limitations remain in effect. Therefore, it is not a shift from A to B, but rather from A to A ∪ B.

This practice is entirely compatible with the PostgreSQL License, but it is often prohibited by GPL variants. You typically cannot combine GPL code with code under most other copyleft licenses, such as the Eclipse Public License.

Regarding copyright status, AI-assisted work is increasingly recognized as copyrightable in many jurisdictions, provided the process involves a sufficient level of human creative input (though the specific threshold varies by jurisdiction). Only work generated purely by AI, with no human involvement, is arguably public domain. In a case like this, which is akin to "pair programming," the output is almost certainly copyrightable.

Re: Postgres rewritten in Rust, now passing 100% of the Postgres regression tests

#387

Hey author here. Wasn't expecting to see this up. To concisely give an overview of the project, I've been experimenting with using LLMs to build a better version of Postgres. Postgres is 30 years old and we've learned a lot about databases since hten. A lot of the techniques that work for doing a rewrite are also useful for doing a rearchitecture. I'm now working on a new, not yet published version of pgrust that inc…

This is how to LLM. Big ups, I wish the whole front page was stuff like this (and I think it'll happen).

Everyone is so worried about the value of commodity software going to zero. It's like, yeah, going into CS for the money always looked dumb to me, it's just not a good career path for that, you have to love it.

I am way more excited about a whole new class of stuff that obliterates the state of the art at every frontier.

Keep doing it legend.

Re: Postgres rewritten in Rust, now passing 100% of the Postgres regression tests

#388
post #262

Hey author here. Wasn't expecting to see this up. To concisely give an overview of the project, I've been experimenting with using LLMs to build a better version of Postgres. Postgres is 30 years old and we've learned a lot about databases since hten. A lot of the techniques that work for doing a rewrite are also useful for doing a rearchitecture. I'm now working on a new, not yet published version of pgrust that inc…

A thread per connection is a almost always the correct decision for performance, but by choosing a process per connection, postgres is able to let you load whatever sketchy extensions you want. Worst case you crash the process, not the database. It would be nice if you could strike a balance so a segfaul in the extension only crashes a small percentage of connections, not the whole thing.

An OS thread per connection can be fine for performance if you don't have to scale your connections, but if you don't need to scale connections why have connections at all? Databases are even more performant when you eliminate connection overhead entirely.

Re: Postgres rewritten in Rust, now passing 100% of the Postgres regression tests

#389
post #48

Earlier quoted context omitted.

AI is an average coder. It was trained on all code the code that could be found. Not just code written by genius programmers like Carmack and Bellard. Given that it's average, I'd prefer a human coder above average :)

I dont think Opus 4.8 is an average coder, with my own experience (I have coded 20 + years before even llms existed) it is anything but average. I don't think training data alone determines the success of these models, there are lots of reinforncement learning principles and fine tuning takes place, a crappy code in the dataset doesnt hold those llms scoring high in benchmarks, I dont think an average programmer can…

I would say it's an average coder when it comes to writing functions because it keeps using regex. It might pass a benchmark but doesn't pass the smell test.

Re: Postgres rewritten in Rust, now passing 100% of the Postgres regression tests

#390
post #162

Regression tests start to play a different role with LLMs. On one hand, they give an LLM a short feedback loop to correct itself, and iterate fast when writing code. A human also uses it as a feedback loop, but we don't iterate as fast and don't handle big walls of conditions, so its effect is not as big. On the other hand, LLM's ability to handle a big wall of if-conditions can backfire if it starts taking shortcuts…

Property testing and deterministic simulation seem like good alternatives.
Post reply on HN