PostgreSQL

2024 Dec 09

Killing a PostgreSQL Connection

Let’s kill a PG connection

2024 Dec 09

PostgreSQL Schemas: Namespacing for Objects

For organizing objects in your DB, or setting up multi-tenancy

2024 Dec 09

PostgreSQL: Create a Read-only User/Group

Let’s create a read only group in PG and add users to it

2024 Nov 29

Timeseries and ASOF Joins

Pairing up timeseries data when the timestamps don’t match exactly (in Pandas, Polars, DuckDB, Postgres & QuestDB)

2024 Nov 15

Archiving Time-Series Data from PostgreSQL into Parquet

Keeping your database lean

2023 Jun 24

Lateral Joins & Iterators in SQL

Sneaking for-loops into SQL without anyone noticing

2020 Jun 07

Generalized Range Difference, Recursion & Search Availability in PostgreSQL

We’re building a scheduling app. Users mark booked slots, represented in Postgres using time or date-range data types. Let’s see how we can find all the freely available slots efficiently

2020 May 28

Speeding up unique constraint checks in PostgreSQL... or not

Are exclusion constraints using hash indexes faster than plain old uniqueness checks? Let’s find out

2020 May 27

SQL gotcha: now() vs 'now'

Make sure you’re using the correct defaults when defining columns

2020 Jan 06

Back To Basics: The foundation of Joins in SQL

Writing SQL joins without using joins at all. A quick history of Database Models, Schemas, Constraints, Cross-products and everything in between

2020 Jan 03

SQL joins as reduce/folds over relations

Of what to make of joins in sql, mental models and building better understanding

2019 Dec 05

Handling Bank Transactions, V2

Version 2 of a simplified Node.js-based API + PG database layer for handling a bank’s intra-account transfer operations

2019 Dec 04

Handling Bank Transactions, V1

Overview of a simplified Node.js-based API + Postgres database layer for handling a bank’s intra-account transfer operations

2019 Nov 20

PG Transactions & Isolation levels: Airline Seat Booking

Using the right isolation level to avoid nasty billing errors when building database-managed booking systems