<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>PostgreSQL on Carlos Souza</title><link>https://csouza.me/tags/postgresql/</link><description>Recent content in PostgreSQL on Carlos Souza</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Mon, 26 Jan 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://csouza.me/tags/postgresql/index.xml" rel="self" type="application/rss+xml"/><item><title>Handling Gaps in Time-Series Data with PostgreSQL's generate_series() and Ecto</title><link>https://csouza.me/posts/handling-gaps-in-time-series-data-with-postgres-and-ecto/</link><pubDate>Mon, 26 Jan 2026 00:00:00 +0000</pubDate><guid>https://csouza.me/posts/handling-gaps-in-time-series-data-with-postgres-and-ecto/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Consider a monitoring system for a weather station. A sensor in the field collects temperature readings every hour and reports them back to the system, but occasionally goes offline due to power outages or maintenance. When generating daily reports, the data shows gaps.&lt;/p&gt;
&lt;p&gt;Querying the readings table for a particular day returns only the hours when the sensor was operational. Asking users to figure out which hours are missing feels like poor UX.&lt;/p&gt;</description></item></channel></rss>