Category

PostgreSQL

Explore our curated collection of articles, insights, and stories about PostgreSQL.

13 Articles
How to Get Enums in Prisma Client: Import, Query
PostgreSQL
7 min read·2026-09-07

How to Get Enums in Prisma Client: Import, Query

Stuck trying to access Prisma enum values? This guide shows you exactly how to import, use, and validate generated enum types in your Node.js app.

Read more
Fix PostgreSQL Server Won't Start on Mac OS X (2026)
PostgreSQL
8 min read·2026-09-03

Fix PostgreSQL Server Won't Start on Mac OS X (2026)

A fresh Homebrew install of PostgreSQL on a Mac completes without errors, then psql answers connection refused because the server was never started. Which command starts it depends on

Read more
Fix: password authentication failed for user "postgres"
PostgreSQL
6 min·2026-08-03

Fix: password authentication failed for user "postgres"

The error fires when psql reaches the password prompt but the password PostgreSQL has on file does not match what you typed — common after switching auth methods, restoring from a dump, or using Docker with a baked-in password. Fix it by setting a password with ALTER USER inside psql, then verifying pg_hba.conf has scram-sha-256 (not md5 or trust) for the line matching your connection.

Read more
Fix: psql: command not found (Install PostgreSQL Client)
PostgreSQL
6 min·2026-08-03

Fix: psql: command not found (Install PostgreSQL Client)

The error fires when the shell cannot locate the psql binary — either PostgreSQL is not installed (only the server or a GUI client is), or it is installed but its bin directory is not on PATH. Fix it by installing the postgresql-client package (apt/brew), installing PostgreSQL itself (choco on Windows), or appending the bin directory to PATH.

Read more
How to Drop All Tables in PostgreSQL Safely (2026)
PostgreSQL
9 min read·2026-07-29

How to Drop All Tables in PostgreSQL Safely (2026)

Dropping tables one by one is painful. Here is the one-command reset, the PostgreSQL 15 permission gotcha that breaks it, and the safe way to do it on Supabase.

Read more
How to Change a PostgreSQL User Password (Supabase)
PostgreSQL
10 min read·2026-07-22

How to Change a PostgreSQL User Password (Supabase)

`ALTER ROLE alice WITH PASSWORD 'newpass';` is the SQL. The psql `\password` prompt avoids logging the cleartext. In Supabase the `postgres` role password is reset from the Dashboard, not SQL. Here is each method, the scram-sha-256 default, and the three things that break after a password change.

Read more
PostgreSQL SHOW TABLES / DESCRIBE TABLE (psql + Supabase)
PostgreSQL
9 min read·2026-07-22

PostgreSQL SHOW TABLES / DESCRIBE TABLE (psql + Supabase)

Coming from MySQL you type `SHOW TABLES` or `DESCRIBE table` and PostgreSQL throws a syntax error — both are MySQL commands. The psql equivalents are `\dt` (list tables) and `\d table_name` (describe a table); the portable SQL equivalents are `information_schema.tables` and `information_schema.columns`. Here is exactly what to run in psql, the Supabase SQL editor, Drizzle, or any client, plus why your query returns zero rows.

Read more
PostgreSQL DESCRIBE TABLE: The psql \d Equivalent
PostgreSQL
5 min·2026-07-21

PostgreSQL DESCRIBE TABLE: The psql \d Equivalent

Coming from MySQL you type DESCRIBE table and psql throws a syntax error. The psql equivalent is \d table_name. For Supabase, Drizzle, or any SQL client without backslash commands, use the information_schema.columns view.

Read more
Fix: Peer Authentication Failed for User "postgres"
PostgreSQL
6 min·2026-07-21

Fix: Peer Authentication Failed for User "postgres"

The error fires when PostgreSQL's peer auth check compares the OS username to the database role and they differ — common after sudo-ing into psql or in local dev. Fix it by matching users, or by switching the local auth method to scram-sha-256 with a real password.

Read more
Fix Postgres 'Could Not Serialize Access' (40001)
PostgreSQL
9 min read·2026-06-18

Fix Postgres 'Could Not Serialize Access' (40001)

Postgres aborts one transaction with 40001 to prevent a serialization anomaly. The docs are explicit: apps using REPEATABLE READ or SERIALIZABLE must be prepared to retry. Here's the correct retry loop and how to reduce conflicts.

Read more
Fix Foreign Key Constraint Violation in Supabase (23503)
PostgreSQL
9 min read·2026-06-18

Fix Foreign Key Constraint Violation in Supabase (23503)

23503 means a foreign key relationship is broken. Inserting a child before its parent? Insert the parent first. Can't delete a parent with children? Choose an ON DELETE action. The most common Supabase case is a profiles row referencing auth.users.

Read more
Select the First Row per Group in Supabase Postgres
PostgreSQL
8 min read·2026-06-18

Select the First Row per Group in Supabase Postgres

The "greatest-N-per-group" problem: one representative row per group. Postgres solves it with DISTINCT ON; supabase-js can't express that directly, so you wrap it in a view or an RPC function. Both confirmed by Supabase maintainers.

Read more
Supabase Enums: ALTER TYPE ADD VALUE in Migrations
PostgreSQL
7 min read·2026-06-02

Supabase Enums: ALTER TYPE ADD VALUE in Migrations

Step‑by‑step guide to adding a PostgreSQL enum type and column in Supabase, including verification and common pitfalls.

Read more