Live data from Hacker News

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

github.com

741–750 of 756 posts

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

#741
post #512

Earlier quoted context omitted.

Passing pointers is not significantly faster than passing offsets into a shared memory pool.

Sorry, what? Passing a pointer is a matter of wrapping the value into the CPU register. OTOH passing an offset into a shared memory is a write to main memory so several magnitudes slower.

Passing a pointer within one thread requires putting the pointer into a register. Passing a SHM offset within one process requires putting the offset into a register.

Passing a pointer between threads requires going through the memory system and letting cache coherence algorithms sort out the data sharing between cores (with or without a futex lock/unlock depending on implementation). Passing a SHM offset between processes requires going through the memory system and letting cache coherence algorithms sort out the data sharing between cores (with or without a context switch to the kernel depending on implementation).

It's not that different.

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

#742
post #722

Earlier quoted context omitted.

It's a matter of whether this project will provide bug fixes, will continue to exist next month and whether the company will end up scrambling to replace it. No CTO cares about (very) questionable "improvements". They care about if it works and will continue to work. Sorry, as someone who has been involved in many of these decisions, I don't think you understand how any of this actually works in the real world.

I mean.. they made it 2 weeks ago. Clearly the time isn't now. Why be so negative immediately.

There are people who see red whenever AI is involved. We've been automating away jobs for years, but now that we're starting to automate our own jobs, all of a sudden it's a moral outrage. People are just being emotional and not thinking straight. It will take a generation or two for it all to be accepted without drama.

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

#743

Earlier quoted context omitted.

I mean.. they made it 2 weeks ago. Clearly the time isn't now. Why be so negative immediately.

There are people who see red whenever AI is involved. We've been automating away jobs for years, but now that we're starting to automate our own jobs, all of a sudden it's a moral outrage. People are just being emotional and not thinking straight. It will take a generation or two for it all to be accepted without drama.

There's so much to do in databases, and it's so hard to get right and test is all, I think we'll all have 10x the jobs. The easy stuff will go away, but to e.g.: test the new DB engine and ensure there aren't any exploits -> let's just work on it. But it's not that the introduction of compilers made engineers obsolete.

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

#744

Earlier quoted context omitted.

Yeah. I'm gonna have an LLM rewrite Star Wars and then film it. Should be fine, right?

Making a movie that has basically the same plot as a previous movie with slight changes is a common occurrence. The thing you have to be wary of with movies is trademark law. Your Star Wars copy can't use the word "Darth Vader", that's trademarked. It can't use Darth Vader's mask, Darth Vader's suit or Darth Vader's breathing either, all trademarked. And with trademark law the bar to pass is basically "would a reason…

Good ol' Varth Dader. A completely novel villain.

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

#745
post #740

Earlier quoted context omitted.

This is where fuzzing would be useful. We have an at-least-parity-bug-level oracle with the reference PostgreSQL implementation. Just build a generator of queries (both invalid and valid) and ensure the output matches. The yardstick is how many log10(queries) it can go on average before a discrepancy is found.

It’s 2026, so another basic technique that every team should add to their testing strategy (in addition to proven techniques like fuzzing) is agentic user simulation. Set up an AI agent with access to the product, and prompt it to use the thing in hundreds of realistic use cases, and to report any possible bugs. It will catch a lot of ‘blind spot’ bugs that were previously things that were only caught by humans.

Debug yourself of the AI hype^. Besides config, SQL implementations have a very limited textual API surface of accepting queries. Putting whole layers of UI and agents around it is really inefficient way of finding edge cases. I wouldn't call that basic, nor the most comprehensive option. Fuzzing at the query layer is far more computationally efficient and effective.

A truly stochastic method is more likely to hit against edge cases, rather than an agent that tends to towards idiomatic solutions and that is trained against a corpus of existing software, and burns millions of tokens/watts spinning its wheels.

^ There's plenty of business value to be found in agentic AI without reaching for it for every solution. I'd even posit agentic AI is even better when paired with focused old-fashioned squishy-brained software engineering in the loop.

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

#746

Earlier quoted context omitted.

Patents and copyright stifles innovation. Knowledge should be communal and free.

Free and communal knowledge means you're easily replaceble by someone else. I wonder what communal answer you have for someone who would say, "moi2388, your work will be now done by moi2389. Thanks and good bye."

First off they can’t just fire me, I’m from a civilised country. Secondly, feel free to use whatever work I have done in the past, I still think you won’t be able to do my work in the future.

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

#747
post #618

Earlier quoted context omitted.

It's not just a rewrite ; it has improvements. I did the same thing for fun for the same reason; I wanted to see if I can improvements on some of the legacy design stuff and, especially, the stuff PG people have told us that it cannot be done differently. It can. I would not put it in production, but it thought me a lot about the internals of databases. To keep my brain happy in the age of LLMs, I implement database…

> I would not put it in production Nobody else would either. If this is meant for personal learning, do it that way and make it clear that others should not even consider using this project. In fact, even for personal learning it's wasteful. You can learn so much about database without a rewrite like this.

but can you? You cannot do a Postgres clone yourself and the Postgres arch makes it rather impossible to just rip out stuff and replace it. So how would I do this. Even with SQLite and me being a very experienced (40 years) c embedded coder; having AI rewrite it to the architecture I would want it to be and then changing things for fun is a better tutor than whatever I could have done with the original in a shorter time.

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

#748

Earlier quoted context omitted.

There is an expectation that threads are more performant than processes all else being equal. Obviously there is some work involved to make "all else be equal", like maybe threads have less isolation from each other etc but if you can mechanically convert code to use threads where it used to use processes I can see the claim standing up.

Threads generally have less memory overhead and context switching between them is theoretically faster, but as I suspect you know it is situational and not as simple as just s/process/thread/g. There are many tradeoffs, including the loss of memory isolation, and since Postgres is a network application which holds a rather important position in most architectures, proper memory isolation is very important. Switching…

I do agree, but maybe there is a valid mechanical conversion thats applicable in the postgresql codebase? I do get what you're saying but on the other hand, if he's passing tests with his conversion then this is different than some hypothetical, I'm just saying I would believe his claim on this one. I'm not going to port my erp to it yet but the performance win could actually be there.

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

#749

Earlier quoted context omitted.

Reputation for reliability can be directly impacted by thousands of upstream dependencies, though.

True, but internal dependencies aren’t upstream. I care very little how a project is laid out on disk before it’s built unless I’m going to work on the source.

All the cargo deps would be "upstream", and pulled on build.

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

#750

Earlier quoted context omitted.

Free and communal knowledge means you're easily replaceble by someone else. I wonder what communal answer you have for someone who would say, "moi2388, your work will be now done by moi2389. Thanks and good bye."

First off they can’t just fire me, I’m from a civilised country. Secondly, feel free to use whatever work I have done in the past, I still think you won’t be able to do my work in the future.

I have a lot of coworkers in civilized countries, they seem to get made redundant too. Sometimes they go on garden leave for a while first but the end result is the same.
Post reply on HN