Top Stories published by Knock Engineering in 2023

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…

About
Knock Engineering
All things Knock engineering & data science.
More information
Tags
Editors