<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>postgres on krtffl.dev</title>
    <link>https://krtffl.dev/tags/postgres/</link>
    <description>Recent content in postgres on krtffl.dev</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <copyright>© [krtffl](https://krtffl.dev)</copyright>
    <lastBuildDate>Mon, 11 May 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://krtffl.dev/tags/postgres/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>clean and verified are different claims: a two-axis trust state machine in postgres</title>
      <link>https://krtffl.dev/posts/two-axis-trust-state-machine/</link>
      <pubDate>Mon, 11 May 2026 00:00:00 +0000</pubDate>
      
      <guid>https://krtffl.dev/posts/two-axis-trust-state-machine/</guid>
      <description>&lt;p&gt;ask a language model for a line of tacitus in spanish and it will hand you a sentence. fluent, confident, correctly punctuated. and sometimes the sentence contains a word that no translator ever wrote — a word a scanner invented, when it read the &lt;code&gt;á&lt;/code&gt; in a 1919 printing as the digit &lt;code&gt;4&lt;/code&gt;, or turned &lt;em&gt;violento&lt;/em&gt; into &lt;code&gt;violen10&lt;/code&gt;, and then a spell-checker came along afterward and smoothed the wreckage into something that &lt;em&gt;looks&lt;/em&gt; like spanish.&lt;/p&gt;
&lt;p&gt;the text is clean. it is not correct. and nothing about the way it reads tells you which.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>i audited my side project like it was about to go viral (before it was)</title>
      <link>https://krtffl.dev/posts/audit-like-it-will-go-viral/</link>
      <pubDate>Mon, 29 Dec 2025 00:00:00 +0000</pubDate>
      
      <guid>https://krtffl.dev/posts/audit-like-it-will-go-viral/</guid>
      <description>&lt;p&gt;i ended the last post with a promise: a public stats page that ran three full-table scans on every request and fell over the first time i pointed real concurrency at it. this is that post — the last of three findings from the same pre-launch audit of a little pairwise-voting side project, a nougat-ranking toy where you pick between two flavours and a leaderboard falls out.&lt;/p&gt;
&lt;p&gt;the first two findings were bugs: &lt;a href=&#34;https://krtffl.dev/posts/elo-lost-update-postgres&#34;&gt;an elo race that ate 79% of every vote&lt;/a&gt;
, and &lt;a href=&#34;https://krtffl.dev/posts/x-forwarded-for-rate-limit-bypass&#34;&gt;a rate limiter a rotated header walked straight through&lt;/a&gt;
. this one is a bug too, but it&amp;rsquo;s really about the &lt;em&gt;method&lt;/em&gt; that surfaced it, because the method is the transferable part. the bug — a page doing linear work per request against a table that only grows — is one you&amp;rsquo;ve almost certainly got somewhere right now and can&amp;rsquo;t see, for the exact reason i couldn&amp;rsquo;t: on your dev box the table has forty rows and everything&amp;rsquo;s instant. the page isn&amp;rsquo;t slow. the page is a landmine with the pin still in, and the only way to find it before your users do is to go step on it yourself.&lt;/p&gt;
&lt;p&gt;so that&amp;rsquo;s the method. stand up a throwaway postgres, seed it with the amount of data you&amp;rsquo;d have &lt;em&gt;if the thing actually worked&lt;/em&gt; — if it went viral, if the launch landed — and then measure the hot paths under that load instead of guessing. the very first page i pointed it at turned out to be a denial-of-service i was hosting for free, on purpose, with a smile.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>the elo race that silently ate 79% of every vote</title>
      <link>https://krtffl.dev/posts/elo-lost-update-postgres/</link>
      <pubDate>Mon, 15 Dec 2025 00:00:00 +0000</pubDate>
      
      <guid>https://krtffl.dev/posts/elo-lost-update-postgres/</guid>
      <description>&lt;p&gt;it&amp;rsquo;s the kind of bug that lets you sleep fine for weeks.&lt;/p&gt;
&lt;p&gt;i&amp;rsquo;d built a little nougat-ranking toy — you get shown two flavours, you pick the one you&amp;rsquo;d rather eat, and an ELO rating quietly updates in the background so a leaderboard falls out of thousands of these pairwise duels. side project, single box, htmx and go and postgres, held together with &lt;code&gt;database/sql&lt;/code&gt; and good intentions. it worked. people voted. the leaderboard moved. every vote came back with a fresh pairing and a &lt;code&gt;200&lt;/code&gt;. green across the board.&lt;/p&gt;
&lt;p&gt;then, before pushing it anywhere with real traffic, i did a proper hardening pass: stand up a throwaway postgres, seed it with a plausible &lt;em&gt;went-viral&lt;/em&gt; amount of data, and hammer every endpoint like someone who wants to break it. the very first thing i measured told me that roughly &lt;strong&gt;four out of every five votes had been quietly doing almost nothing&lt;/strong&gt; the whole time.&lt;/p&gt;
&lt;p&gt;not erroring. not failing. the vote was recorded. the rating just didn&amp;rsquo;t move the way it was supposed to.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>sqlc &#43; pgx over an orm: type-safe sql that fails at compile time</title>
      <link>https://krtffl.dev/posts/sqlc-vs-orm-in-go/</link>
      <pubDate>Mon, 24 Nov 2025 00:00:00 +0000</pubDate>
      
      <guid>https://krtffl.dev/posts/sqlc-vs-orm-in-go/</guid>
      <description>&lt;p&gt;the endpoint was slow and i couldn&amp;rsquo;t tell you which query to blame, because i hadn&amp;rsquo;t written any. that&amp;rsquo;s the deal you sign with a reflection-based orm: you describe some structs, you call &lt;code&gt;db.Preload(&amp;quot;Photos&amp;quot;).Find(&amp;amp;pets)&lt;/code&gt;, and somewhere behind the curtain the library assembles sql you never see, fires off a number of round trips you never counted, and hands you back objects. when it&amp;rsquo;s fast, it&amp;rsquo;s lovely. when it&amp;rsquo;s slow, you&amp;rsquo;re debugging a library&amp;rsquo;s imagination.&lt;/p&gt;</description>
    </item>
    
  </channel>
</rss>
