TIL — Postgres slow queries with pg_stat_statements

Using the pg_stat_statements extension, we can quickly identify problematic queries.

SELECT
userid::regrole AS "user",
"query",
-- Number of times the query has been called
calls AS "num_calls",
-- Total…

TIL — Postgres user-defined data types with DOMAINs

We can create a user-defined data type with constraints using DOMAIN. We will use citext here, so the email field is case-insensitive.

-- Install citext extension
CREATE EXTENSION IF NOT EXISTS "citext";

-- Create…

Knock and Open Source

Knock.com is built with Open Source Software (OSS). It permeates our technology stack from the interactive website all…