
SQL editor, scheduler, and pipelines in one native Mac app. Daily notes for people who write queries.
- Tweets892
- Following193
- Followers50
- Likes1.1K

ALT Frozen star. Before/after, SELECT * inside a Postgres view: CREATE VIEW v_customers AS SELECT * FROM customers; ALTER TABLE customers ADD COLUMN email text; then CREATE OR REPLACE VIEW v_customers AS SELECT * FROM customers picks up email. After ALTER the view shows id, first_name, last_name; after REPLACE it shows id, first_name, last_name, email.

ALT Find the blocker. A Postgres query on pg_stat_activity that selects pid, pg_blocking_pids(pid) as blocked_by, and the first 50 characters of the query, filtered to sessions where pg_blocking_pids is not empty. Example result: a waiting UPDATE orders SET status = 'void', blocked by the session holding the lock.









