<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Postgresql on Lorbic</title><link>http://localhost:1313/tags/postgresql/</link><description>Recent content in Postgresql on Lorbic</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sun, 09 Aug 2026 14:00:00 +0530</lastBuildDate><atom:link href="http://localhost:1313/tags/postgresql/index.xml" rel="self" type="application/rss+xml"/><item><title>Designing a Distributed Job Scheduler in Go: Partitioning, Locking, and Backpressure</title><link>http://localhost:1313/designing-a-distributed-job-scheduler/</link><pubDate>Sun, 09 Aug 2026 14:00:00 +0530</pubDate><guid>http://localhost:1313/designing-a-distributed-job-scheduler/</guid><description>&lt;p>Linux &lt;code>crontab&lt;/code> is one of the most elegant pieces of software ever written for single-host automation. It is simple, clear, and has kept Unix systems running reliably since 1975.&lt;/p>
&lt;p>The problem starts when we take a single-host tool and deploy it across a multi-node cloud setup.&lt;/p>
&lt;p>In &lt;a href="http://localhost:1313/how-multi-tenant-saas-works/">Relay&lt;/a>, a multi-tenant AI API gateway system design, background jobs power core operations: every top of the hour, a job rolls up raw API usage tokens into tenant billing metrics; every 15 minutes, another job scans for expired API keys and purges them from cache; every 30 seconds, a health checker pings upstream LLM provider endpoints.&lt;/p></description></item><item><title>Just About Go Time</title><link>http://localhost:1313/just-about-go-time/</link><pubDate>Sun, 10 May 2026 22:00:00 +0530</pubDate><guid>http://localhost:1313/just-about-go-time/</guid><description>&lt;p>Time is an illusion. Or more accurately, time is a political consensus poorly masquerading as physics.&lt;/p>
&lt;p>&lt;picture class="optimized-image-container">&lt;source srcset="http://localhost:1313/just-about-go-time/time-theory-meme_hu_c027f9156a69cf21.webp 480w, http://localhost:1313/just-about-go-time/time-theory-meme_hu_c74845a5e28401ee.webp 800w, http://localhost:1313/just-about-go-time/time-theory-meme_hu_22fbca4a5f8175a5.webp 1200w, http://localhost:1313/just-about-go-time/time-theory-meme_hu_c495ad8b67b2bacf.webp 1222w" sizes="(max-width: 800px) 100vw, 800px" type="image/webp">&lt;img src="http://localhost:1313/just-about-go-time/time-theory-meme_hu_c495ad8b67b2bacf.webp" width="1222" height="1514" alt="Time is relative, absolute, and a scam" loading="eager" decoding="async" fetchpriority="high" class="img-fluid" />
 &lt;/picture>&lt;/p>
&lt;p>If you&amp;rsquo;ve ever seen Dylan Beattie&amp;rsquo;s &amp;ldquo;Plain Text&amp;rdquo; &lt;a href="https://www.youtube.com/watch?v=gd5uJ7Nlvvo" target="_blank" rel="noopener noreferrer">talk&lt;/a>, you know that humans have spent centuries making data storage as complicated as possible. But text encoding has nothing on time zones.&lt;/p>
&lt;p>As engineers, we like to pretend that &lt;code>time.Now()&lt;/code> returns an objective truth. It doesn&amp;rsquo;t. It returns a snapshot of a highly contested, historically unstable set of political boundaries. In 2011, the island nation of Samoa decided they wanted to align their workweek with Australia rather than the United States. To do this, they didn&amp;rsquo;t just change their clocks; they completely skipped Friday, December 30th. At 11:59 PM on Thursday, the clock ticked over, and it was suddenly Saturday.&lt;/p></description></item><item><title>Building a Poor Document Store inside PostgreSQL</title><link>http://localhost:1313/building-a-poor-document-store-inside-postgresql/</link><pubDate>Sat, 09 May 2026 22:00:00 +0530</pubDate><guid>http://localhost:1313/building-a-poor-document-store-inside-postgresql/</guid><description>&lt;p>The marketing for &amp;ldquo;schemaless&amp;rdquo; architecture was brilliant. It promised speed, agility, and a life free from the tyranny of &lt;code>ALTER TABLE&lt;/code> migrations. When PostgreSQL introduced &lt;code>JSONB&lt;/code> in version 9.4, many developers saw it as a green light to treat Postgres like MongoDB.&lt;/p>
&lt;p>I’ve seen this pattern in dozens of codebases. It starts with a single &lt;code>metadata&lt;/code> column, but within months, the entire business logic is buried inside a 2MB JSON blob.&lt;/p></description></item><item><title>PostgreSQL Migrations in Go: Production Schema Patterns with Goose</title><link>http://localhost:1313/postgresql-migrations-in-go-production-schema-patterns-with-goose/</link><pubDate>Fri, 08 May 2026 22:00:00 +0530</pubDate><guid>http://localhost:1313/postgresql-migrations-in-go-production-schema-patterns-with-goose/</guid><description>&lt;p>Application code is stateless. You can tear down a container and spin up a new one in milliseconds without losing data. Databases are stateful. When you deploy new application logic that requires a new column, an index, or a table, you must transition the physical storage schema from state A to state B without destroying the underlying data or locking the system.&lt;/p>
&lt;p>This process is a database migration. Working with databases is the kind of thing I will gladly skip dinner for (:&lt;/p></description></item><item><title>ClickHouse vs. Postgres: When to Move Your Logs Out of a Relational DB</title><link>http://localhost:1313/clickhouse-vs-postgres-log-storage/</link><pubDate>Mon, 30 Mar 2026 22:45:00 +0530</pubDate><guid>http://localhost:1313/clickhouse-vs-postgres-log-storage/</guid><description>&lt;p>Postgres is the most reliable tool in my stack. It handles users, configurations, and complex relations without breaking a sweat. But databases, like any physical system, have a &amp;ldquo;design limit&amp;rdquo;. For Postgres, that limit usually appears when you try to use it as a dumping ground for high-velocity logs and metrics.&lt;/p>
&lt;p>When your &lt;code>ANALYZE&lt;/code> commands start taking minutes and your indexes consume more RAM than your data, you aren&amp;rsquo;t facing a Postgres bug; you&amp;rsquo;re facing an architectural mismatch.&lt;/p></description></item><item><title>Setting Up a PostgreSQL Container: A Quick Guide</title><link>http://localhost:1313/setting-up-a-postgresql-container-a-quick-guide/</link><pubDate>Sat, 01 Apr 2023 06:41:46 +0000</pubDate><guid>http://localhost:1313/setting-up-a-postgresql-container-a-quick-guide/</guid><description>&lt;p>Learn the simple and fast process of creating a PostgreSQL container using Docker. This guide provides both the command and a detailed explanation of the container and PostgreSQL database configuration.&lt;/p>
&lt;h2 id="1-create-the-postgresql-container">1. Create the PostgreSQL Container:&lt;a class="anchorjs-link" href="#1-create-the-postgresql-container" aria-label="Link to section: 1. Create the PostgreSQL Container:">&lt;/a>&lt;/h2>&lt;div class="code-block">
 &lt;div class="code-header">
 &lt;div class="header-left">
 &lt;span class="code-lang">shell&lt;/span>
 &lt;/div>
 &lt;div class="header-right">
 &lt;button class="wrap-code-button" title="Toggle line wrap" aria-label="Toggle line wrap">
 &lt;svg class="svg-icon " aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">&lt;path d="M448 256c0-53-43-96-96-96H96c-17.7 0-32 14.3-32 32s14.3 32 32 32h256c17.7 0 32 14.3 32 32s-14.3 32-32 32H165.5l37.3-37.3c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3l96 96c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L165.5 352H352c53 0 96-43 96-96zM32 64C14.3 64 0 78.3 0 96s14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H32zM32 384c-17.7 0-32 14.3-32 32s14.3 32 32 32H256c17.7 0 32-14.3 32-32s-14.3-32-32-32H32z"/>&lt;/svg>

 &lt;/button>
 &lt;button class="download-code-button" data-lang="shell" title="Download Code" aria-label="Download Code">
 &lt;svg class="svg-icon " aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">&lt;path d="M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32V274.7l-73.4-73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L288 274.7V32zM64 352c-35.3 0-64 28.7-64 64v32c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V416c0-35.3-28.7-64-64-64H346.5l-45.3 45.3c-25 25-65.5 25-90.5 0L165.5 352H64zm368 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"/>&lt;/svg>

 &lt;/button>
 &lt;button class="copy-code-button" title="Copy Code" aria-label="Copy Code">
 &lt;svg class="svg-icon " aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">&lt;!--! Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc. -->&lt;path d="M384 336H192c-8.8 0-16-7.2-16-16V64c0-8.8 7.2-16 16-16l140.1 0L400 115.9V320c0 8.8-7.2 16-16 16zM192 384H384c35.3 0 64-28.7 64-64V115.9c0-12.7-5.1-24.9-14.1-33.9L366.1 14.1c-9-9-21.2-14.1-33.9-14.1H192c-35.3 0-64 28.7-64 64V320c0 35.3 28.7 64 64 64zM64 128c-35.3 0-64 28.7-64 64V448c0 35.3 28.7 64 64 64H256c35.3 0 64-28.7 64-64V416H272v32c0 8.8-7.2 16-16 16H64c-8.8 0-16-7.2-16-16V192c0-8.8 7.2-16 16-16H96V128H64z"/>&lt;/svg>
 &lt;/button>
 &lt;/div>
 &lt;/div>
 &lt;div class="code-body">&lt;div class="highlight">&lt;pre tabindex="0" style="color:#e6edf3;background-color:#0d1117;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#6e7681">1&lt;/span>&lt;span>docker run -d --name postgres &lt;span style="color:#79c0ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#6e7681">2&lt;/span>&lt;span>&lt;span style="color:#79c0ff">&lt;/span> -e &lt;span style="color:#79c0ff">POSTGRES_PASSWORD&lt;/span>&lt;span style="color:#ff7b72;font-weight:bold">=&lt;/span>RunningFlying2 &lt;span style="color:#79c0ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#6e7681">3&lt;/span>&lt;span>&lt;span style="color:#79c0ff">&lt;/span> -e &lt;span style="color:#79c0ff">PGDATA&lt;/span>&lt;span style="color:#ff7b72;font-weight:bold">=&lt;/span>/var/lib/postgresql/data/pgdata &lt;span style="color:#79c0ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#6e7681">4&lt;/span>&lt;span>&lt;span style="color:#79c0ff">&lt;/span> -v postgres_data:/var/lib/postgresql/data &lt;span style="color:#79c0ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#6e7681">5&lt;/span>&lt;span>&lt;span style="color:#79c0ff">&lt;/span> -p 5432:5432 &lt;span style="color:#79c0ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#6e7681">6&lt;/span>&lt;span>&lt;span style="color:#79c0ff">&lt;/span> postgres:latest
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#6e7681">7&lt;/span>&lt;span> &lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;/div>
&lt;/div>&lt;h2 id="2-explanation">&lt;strong>2. Explanation:&lt;/strong>&lt;a class="anchorjs-link" href="#2-explanation" aria-label="Link to section: 2. Explanation:">&lt;/a>&lt;/h2>&lt;p>The above command initiates the creation of a container with the latest version of PostgreSQL. Here&amp;rsquo;s a breakdown of the parameters used:&lt;/p></description></item></channel></rss>