HN user

pjungwir

4,169 karma

https://illuminatedcomputing.com/

pj@illuminatedcomputing.com

[ my public key: https://keybase.io/pjungwir; my proof: https://keybase.io/pjungwir/sigs/18RLNIH6b2Dlda44UTBZU_M50U7MmWCTjBKoF813ZOA ]

Posts49
Comments1,223
View on HN
illuminatedcomputing.com 15h ago

TQuel Paper: Implementing Temporal Operators in Postgres

pjungwir
1pts0
illuminatedcomputing.com 1mo ago

My Claude Code Setup

pjungwir
11pts1
www.tembo.io 1y ago

Autonomous Software Maintenance Has Arrived

pjungwir
2pts0
illuminatedcomputing.com 1y ago

Solving bison shift/reduce conflicts in Postgres

pjungwir
1pts0
illuminatedcomputing.com 2y ago

Debugging the Sprinkler System

pjungwir
3pts0
hanamirb.org 6y ago

Hanami:API

pjungwir
2pts0
www.cybertec-postgresql.com 6y ago

Row change auditing options for PostgreSQL

pjungwir
4pts0
rachelbythebay.com 7y ago

Disappearing videos and disappointed grandmothers

pjungwir
251pts104
samsaffron.com 8y ago

Ruby's external malloc problem

pjungwir
2pts1
illuminatedcomputing.com 8y ago

JavaScript Daylight Savings Time: One Weird Trick Your Application Hates

pjungwir
2pts0
illuminatedcomputing.com 8y ago

What to Learn

pjungwir
1pts0
illuminatedcomputing.com 9y ago

Postgres Permissions

pjungwir
1pts0
blog.ably.io 9y ago

Rails ActionCable – The good and bad parts

pjungwir
2pts1
blog.acolyer.org 9y ago

Data on the outside versus data on the inside (2016)

pjungwir
2pts0
blog.acolyer.org 9y ago

On the criteria to be used in decomposing systems into modules

pjungwir
1pts0
illuminatedcomputing.com 9y ago

When the Inner JSON Effect Works (2016)

pjungwir
5pts0
illuminatedcomputing.com 10y ago

Postgres custom range types for geoip

pjungwir
2pts0
blog.acolyer.org 10y ago

Hacking Blind: Defeating stack overflow canaries

pjungwir
1pts1
www.andl.org 10y ago

Andl, a relational language that is not SQL, is coming to Postgres

pjungwir
272pts104
rachelbythebay.com 10y ago

A mystery with memory leaks and a magic number

pjungwir
6pts0
news.ycombinator.com 10y ago

Ask HN: Sharing a shared hosting account with non-technical clients

pjungwir
3pts3
illuminatedcomputing.com 10y ago

Ledger with Autosync

pjungwir
2pts0
www.postgresql.org 11y ago

“A huge debt of gratitude” – Michael Stonebraker

pjungwir
1pts0
news.ycombinator.com 11y ago

Ask HN: Discussion board implemented on BitTorrent?

pjungwir
1pts0
news.ycombinator.com 11y ago

Ask HN: What happened to Bufferbloat?

pjungwir
12pts6
news.ycombinator.com 11y ago

Ask HN: Are there programs whose halting status is undecidable?

pjungwir
6pts8
illuminatedcomputing.com 11y ago

Postgres LATERAL join

pjungwir
2pts0
blogs.discovermagazine.com 11y ago

Linux versus E. coli (2010)

pjungwir
2pts0
www.illuminatedcomputing.com 11y ago

Postgres CTE for Threaded Comments

pjungwir
5pts0
rubylearning.com 12y ago

Ruby Matrixes

pjungwir
1pts0

When I was still much more skeptical of AI, I asked ChatGPT to write me a proof of the Goldbach Conjecture. Of course it didn't, but it gave me a several-screens-long research program for how one might get there, with a few alternate paths and what pieces are still missing from each one. Maybe it cribbed that all from some grad student's blog, but it was still pretty impressive.

A week or two ago I asked Claude Code to write a comprehensive testing plan for a new Postgres feature I wrote, UPDATE/DELETE FOR PORTION OF. I was a bit anxious about how many bugs were discovered as soon as it was merged this spring. Claude found some untested areas, then it wrote more tests for them. I'm not talking about LOC covered, but feature combinations. (I've been meaning to submit this as a followup patch. . . .) Fortunately it didn't find any more bugs.

I sense that testing plan has affinity with the findings in the OP, even though it is far more humble than research mathematics. Even better would be if we knew good ways to express invariants about Postgres's behavior, and then we could ask LLMs to violate them. I'm sure there are good ways already, and the "we" who is not knowing is not "all humans" but "the Postgres team" or just "me".

As a counterexample to the article (heh): even though Claude didn't uncover any new bugs, a human did, just a few days ago. Alas!

I think yes. You're saying that the invoice is generated from other data in separate tables, and it should be immutable even if that data changes. So today you are copying everything used by the invoice.

That's exactly why I started learning about temporal tables. I had a customer whose app used questionnaires to measure the effectiveness of government social services, and they let people change the questions (and multiple choice options) even after there were answers! Obviously the data was trashed.

I've seen this bug over & over again, where you have a foreign key relationship, and the referenced table changes, but the referencing table needs the old data. Another example is a sale that doesn't capture the product's current price.

Temporal tables mean that you can run your 2022 financial reports and get the same answer you got before.

My own time-tracking and invoicing app has to solve this problem. I also "copy everything" when something changes. I just gave a talk about migrating it to temporal tables: https://illuminatedcomputing.com/pages/pgdata2026-migrating-...

You'll have to decide if your use-case is more "system time" (history of the database) or "application time" (history of the entities). The features here are for application time. I want to make sure Postgres gets system time too, but it's not in v19.

If you want system time today, there are several widely-adopted Postgres extensions that can do that already. I cover them here: https://illuminatedcomputing.com/posts/2017/12/temporal-data...

And actually, application time is managed by you (while system time is managed automatically by the database), so really you can use it for whatever you want.

In the Postgres version, you can use a rangetype or multirangetype over any base type (integers, inets, frammishes, etc). This is a generalization of SQL:2011, where PERIODs have to be on date/timestamp/timestamptz columns. I have ambitions to support non-range/multirange types as well, even user defined types, but I'll need to add a way for them to communicate a few things to core Postgres, like how to do intersect/contains/overlaps. I talked about that in my "roadmap" talk linked here if you're interested in details.

For application time, everything lives in one table (although you could partition it). The biggest performance hit, I suspect, will come from GiST indexes instead of B-Trees. Some general GiST improvements are on my TODO list, and I learned at PGConf.dev that several other people already have patches for cool perf-related GiST enhancements.

For system time, a separate history table is a common implementation, sometimes also with partitioning. Here is what other vendors are doing: https://illuminatedcomputing.com/posts/2019/08/sql2011-surve...

Hey I worked on this!

Thank you to everyone here saying they are excited about it. I often hear doubts that anyone wants this. Perhaps that's why vendors have been so slow to add it. And thank you 'bonesmoses for writing about it!

We are still missing system time, but if no one else wants to work on it, I hope to tackle that soon.

I have a lot of other ideas for improvement beyond SQL:2011, too. Here is a talk I gave last month about my personal roadmap:

https://illuminatedcomputing.com/pages/pgconf2026-temporal-r...

I've also been vibecoding a lisp REPL to play with the algebra of temporal relational operators (important for the planner): https://github.com/pjungwir/relsim

That overlaps with my attempt to write implementations for temporal semi/anti/outer-join and other relops: https://github.com/pjungwir/temporal_ops

If anyone has comments about what you'd like to see, I'm happy for feedback!

Yes, I su to the user. Typically I have it run a tmux session for each "project". That makes it easy to get more windows without su'ing over and over. Also its tmux sessions all get a yellow status bar (in ~claude/.tmux.conf), so they are easy to recognize.

To me it is more convenient than a VM, since everything is on the host. And it can launch its own VMs without an extra layer.

I don't really know which is more secure. There are hypervisor escape vulns too. And shared folders seem like footguns. For instance in vagrant, guests get `/vagrant` to read/write the host's folder, so you have to be careful what you put where.

The biggest annoyance with an OS user so far is running docker containers. I don't want to add claude to the docker group or give it sudo privileges. I've read that you can set up rootless docker for a user, and even that you can run it side-by-side with a normal system-wide docker, but I haven't tried doing that yet.

I know there are VM solutions, but I've been happy with a separate OS user (named `claude`).

He has similar dotfiles to mine, but no secrets. My own home directory is 0700. He has his own ssh key that I added to my github profile, but it's password-protected, and I push/pull for him. He has his own Postgres (non-superuser!) {development,test} {users,databases}.

It's as if he were another developer on the project. If he needs something run with sudo, he asks me. Often we can both work on something in parallel. Unix was supposed to be a multi-user system after all.

A trick I use a lot is that many of his git repos have an extra remote, like this:

    paul  ssh://paul@localhost/~/src/example (fetch)
    paul  ssh://paul@localhost/~/src/example (push)
That makes it easy to collaborate on things I'm not ready to share.

I'm pretty comfortable with this setup.

I do worry about Linux privilege escalation bugs. I don't trust an AI to understand that exploiting vulns is not acceptable. (I can't help but recall that at my first job I may have misused vim's :! feature to broaden my sudo powers, which were officially limited to editing httpd.conf, when I needed something in a hurry. . . .) I find myself manually upgrading packages more often these days, despite automatic security updates. I don't think Opus would go to the trouble of looking up security vulns, but maybe Fable would, and there have been a lot lately. Maybe some future model will just take it upon itself to find new ones. Or install a keylogger to learn the ssh key password.

But a separate user is nearly the most paranoid setup I've heard of, excepting only a separate machine. So I also question whether I'm sacrificing too much speed/convenience. But really it's still very convenient. I think it's a good way of being efficient but responsible.

If other people see holes, I'd be happy to hear about them.

Progressive JSON 1 year ago

Does this scheme give a way to progressively load slices of an array? What I want is something like this:

    ["foo", "bar", "$1"]
And then we can consume this by resolving the Promise for $1 and splatting it into the array (sort of). The Promise might resolve to this:
    ["baz", "gar", "$2"]
And so on.

And then a higher level is just iterating the array, and doesn't have to think about the promise. Like a Python generator or Ruby enumerator. I see that Javascript does have async generators, so I guess you'd be using that.

The "sort of" is that you can stream the array contents without literally splatting. The caller doesn't have to reify the whole array, but they could.

EDIT: To this not-really-a-proposal I propose adding a new spread syntax, ["foo", "bar", "...$1"]. Then your progressive JSON layer can just deal with it. That would be awesome.

I've seen this a lot when someone wants to add "workflow automation" or "scripting" to their app. The most success I'd had is embedding either Lua or Javascript (preferably Lua) with objects/functions from the business domain available to the user's script. This is what games do too. I think it's a great way to dodge most of the work. For free you can support flow control, arbitrary boolean expressions, math, etc.

SEEKING WORK - Portland, OR or Remote

I'm a full-stack developer with 20+ years experience. My specialties are deep Postgres consulting, web development in Rails/Django, and devops with Kubernetes, AWS, Azure, Terraform, Ansible, etc. From time to time I've done projects in Javascript/Typescript (React, Vue, Angular, Node), Java, C#, C, Go, Rust, Elixir, Perl, etc.

I am reliable, easy to work with, quick to turn things around, and a good communicator. I can work solo or on a team, either as lead or a team member. I value client satisfaction as highly as technical excellence.

You can see some of my recent work here:

https://illuminatedcomputing.com/portfolio

https://commitfest.postgresql.org/49/4308/ (Adding SQL:2011 application-time to Postgres)

https://commitfest.postgresql.org/31/2112/ (Adding multiranges to Postgres)

https://github.com/pjungwir/aggs_for_arrays

https://github.com/pjungwir/aggs_for_vecs

https://github.com/pjungwir/active_model_serializers_pg

If you'd like to work together, I'd be happy to discuss your project!: pj@illuminatedcomputing.com

Great article! I'm looking forward to reading the rest of the series.

I noticed a couple details that seem wrong:

- You are passing `context` to `log_then_get` and `get`, but you never use it. Perhaps that is left over from a previous version of the post?

- In the fiber example you do this inside each fiber:

    responses << log_then_get(URI(url), Fiber.current)
and this outside each fiber:
    responses << get_http_fiber(...)
Something is not right there. It raised a few questions for me:

- Doesn't this leave `responses` with 8 elements instead of 4?

- What does `Fiber.schedule` return anyway? At best it can only be something like a promise, right? It can't be the result of the block. I don't see the answer in the docs: https://ruby-doc.org/3.3.4/Fiber.html#method-c-schedule

- When each fiber internally appends to `responses`, it is asynchronous, so are there concurrency problems? Array is not thread-safe I believe. So with fibers is this safe? If so, how/why? (I assume the answer is "because we are using a single-threaded scheduler", but that would be interesting to put in the post.)

Calagator has been dead for years, and I don't understand why. Way before the pandemic: agreed. Most of what I see there now is business networking or people selling something.

But there are still things happening, e.g.:

- pdxpug (Postgres)

- Database Reading Group (DBRG) at PSU

- pdx.rb

- pdxruby Slack channel

- pdxstartups Slack channel

- Portland Papers We Love

- Portland Linux Users Group

- Linux Kernel meetup

- Rose City Techies

That's from just a little bit of research. But I miss when Calagator was full of cool stuff. What happened there I wonder?

I've tried hosting things in my home/back yard before. One was just to come hack on your projects together. Another was to work on open source contributions. I'd be up for trying something like that again. Something about systems/databases would be right up my alley. Maybe a reading group. If anyone sees this and is interested, send me an email.

Indeed, if you read The Goal or The Phoenix Project, they call this "slack". There is a whole theory about why slack matters.

Oh this is very helpful!

When I read Turing's paper some years ago, this really confused me. The best sense I could make was that "circle-free" means "halts". But in popular explanations, writers often equate "halts" with "gives a result" and "doesn't halt" with "has a bug", i.e. an infinite loop. And Turing seems to connote just the opposite. The point is to print a real number, so if the program stops printing digits, something went wrong. (I guess many numbers would end in 0s forever.) From today's paper:

a program is circular, when it produces only finitely many digits of the output digit sequence, and circle-free, when it has succeeded in giving us an infinite digit sequence for the output real number.

But I could never really believe my interpretation. It was just the best I could come up with, as an amateur reading the paper alone for fun. Later I read Petzold's book, and I'm not sure that really solved the trouble for me either.

I've only read a few pages so far, but I'm gathering it's not as simple as I wanted: "circle-free" is not merely equivalent to "halts" after all. I'm looking forward to seeing their more nuanced take.

EDIT: Btw, this reminds me of the best riddle I've ever invented myself. Q: What do you call a fully autonomous self-driving car that can operate with as much understanding as a person? A: N Gheavat Znpuvar. (I didn't say it was a good riddle.)

Entire C++ servers with hundreds of lines of code can be built from scratch in a minute or two tops.

Hundreds, huh? Is this a typo? It makes me wonder if the whole comment is facetious. Or do C++ programmers just have very low expectations for build time?

I just finished reading Kernighan & Pike's The Unix Programming Environment this weekend, and it has a lot of awk. I read it more as a history book (it was published 40 years ago!), but the awk parts were a highlight, second only to the long penultimate chapter building your own calculator/programming language. It kind of made we want to learn more than just the basics I've been using for almost 25 years. But it also recalled Larry Wall's intro in Learning Perl, and how Perl started as a "better awk". That intro is really a direct response to K&P's book I think. So I don't know. I loved Perl in those days, and I agree about how not everything is doable as a shell pipeline. But a second edition makes me want to read it anyway. :-)

I've personally also used identity theft protection services since as far back as the 90's now, simply to know when actions such as credit enquiries appear against my name.

I've always thought companies offer those for ulterior motives, e.g. maybe they get a fee for giving the protection service future customers. Do others use them? Maybe I've been wrong here.

I think it would be cool if stdout worked something like the clipboard, where you have different representations, and when an application copies something from the clipboard it selects the representation it wants. I'm not sure how to avoid making it terribly wasteful though, so that the producing application doesn't have to write in every format possible.

Not exactly what you asked for, but you should look up Chef (not the devops tool). It was part of an MIT Mystery Hunt one year. You could certainly write the recipes with a royal style.

Re the stuff about @-moz-document at the end, does anyone remember exploiting IE bugs in parsing CSS to present different rules for IE vs firefox, especially to work around IE's broken box model? I remember actually using this[0] hack somewhere long ago:

    div.content { 
      width:400px; 
      voice-family: "\"}\""; 
      voice-family:inherit;
      width:300px;
    }
I can't believe the stuff we used to go through.

[0] http://tantek.com/CSS/Examples/boxmodelhack.html

I’m glad that some people never develop epistemic learned helplessness, or develop only a limited amount of it, or only in certain domains.

What always struck me about famous philosophers is that almost none of them ever changed their minds. They grasped a main idea, turned it into a supreme principle, built everything around it, and defended their system against all critiques their whole life. I know this is simplifying but I think it's pretty close.

And yet when I read their works, it's easy to see flaws in their position. So I've always wondered how they could have such tenacity. I'm glad they did though. But it feels like they sacrificed their own life for the rest of us, so that we could see where one idea goes: what it looks like when it's fully developed.

When I play chess, I can never go very deeply down a single line before I get distracted by alternatives. But I guess some people are doing a depth-first search. I don't get it, and they may be wrong, but it's like a service to us all.

Something I've been curious about lately is: why do we find elements on Earth clumped together, for example veins of iron or gold? I can understand coal or oil since that comes from something organic that put it there. But what about elemental substances? When I throw stuff into my blender or spice mixer it gets pretty homogeneous. Surely an exploding star ought to mix things up better than that. So is there something that brings the iron & gold back together again? I don't know if this is a question for an astrophysicist, chemist, or geologist, but I suppose HN has all three. :-)