HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
posix4e
rpgffi
Rust2016–2024
posix4e / rpgffi

rpgffi

R(Rust) PG(Postgresql) FFI (Foreign Function Interface)

6Distinct people
8Mentions
0Explicit recommenders
84GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

R(Rust) PG(Postgresql) FFI (Foreign Function Interface)

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year8 dated mentions

Observed mentions: 2016-06-07 00:35:43 UTC to 2024-08-10 23:07:07 UTC.

0122016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 2 mentions; 2 submissions, 0 comments20162017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20202021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2024

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC220
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC202
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC202
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC000
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC101
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC000
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC000
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC000
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC101

What Hacker News says

8 sources
Wow I think i build one of the first pg-rust-cdc replication module for postgresql and now it seems mainstream. It was a part of my https://github.com/posix4e/rpgffi project, which is garbage code I'm now embarrassed about. Rust programming has come a long way and we didn't have the best practices. Now it seems actual grownup engineering teams are living the dream. We truly live in the best of all universes.
In Show HN: Pg_replicate – Build Postgres replication applications in Rust
Since a lot of languages have FFIs for C this made me wonder, did anyone try to write a PostgreSQL extension in... Rust? Turns out a few people have been working on doing just that. * JSONDC, a PostgreSQL extension written in Rust. Latest commit about a month ago. 161 commits in total. Authors say “It is written in Rust and, being short, is a good skeleton project for other would be plugin authors who'd like to use Rust to write Postgres extensions”. https://github.com/instructure/jsoncdc * pgxr. Latest commit 20 days ago. 23 commits in total. “Write PostgreSQL extension functions (as stored procedures) using Rust.”. https://github.com/clia/pgxr * RPGFFI. Latest commit about a year ago. 33 commits in total. “Imagine being able to create postgresql extensions in rust. We generate bindgen (0.29.1) pg apis for [...]”. https://github.com/posi
Read the rest
x4e/rpgffi/ * postgres-extension.rs. Latest commit over 2 years ago. 23 commits in total. “Library to write Postgres extensions in Rust! Overall, the Postgres codebase has some pretty narly C macros everywhere, so we have to work around them a little bit.” https://github.com/thehydroimpulse/postgres-extension.rs
In How Postgres is more than a relational database: Extensions
I'm not sure there's much reason to rewrite Postgres as a whole. If there are specific subsystems which are common sources of CVE they might be targets, but looking at the list[0] no specific system really seems to jump out. Extensions could be neat, there doesn't seem to be a high-level Rust API for it (in the style of ruru or rust-cpython) yet though, only incomplete-looking bindgen: https://github.com/posix4e/rpgffi [0] https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=postgresql
In RustgreSQL
Postgres's extension APIs are pretty good and Rust's interoperability with C makes it quite feasible to extend the database without rewriting it. Some months ago we wrote a logical decoder -- to capture and forward the write-ahead log as JSON -- in Rust and later were able to pull out some helpful bindings for logical decoders, foreign data wrappers and so forth. The logical decoder: http://pgxn.org/dist/jsoncdc The bindings: https://github.com/posix4e/rpgffi The extensibility of Postgres is really profound -- there are so many things you can do, and so much internal functionality you can access, without having to recompile the database. The way extensions are loaded also mitigates the risk of what can be admittedly tricky issues relating to safety. Extensions run in backend processes, not the postmaster. If rewriting Postgres happens, I
Read the rest
hope it would be gradual. You can replace a lot of the core with extensions, and the scope for extension is ever increasing. So say you wrote a storage engine in Rust. Writing a foreign data wrapper for it would give you a way to use it from Postgres for all your tables; but you wouldn't have to write a SQL parser, client manager, permissions system, or any of the rest of that stuff. Although the C stuff is a little gritty, a lot of what goes on in a database is gritty "because it is" and that low-level control is needed to deliver on tail latency, fault tolerance or simple storage efficiency. For example, Postgres has code to recover from malloc failing.
In RustgreSQL

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.