## TL;DR

The first time you use PostgresSaver against a database, call checkpointer.setup() before anything else: with PostgresSaver.from_conn_string(DB_URI) as checkpointer: checkpointer.setup(). You only need it once per database, so gate it behind a first-run flag.

## Steps

1. [alberto-agudo (commenter)]: You skipped the one-time schema setup. The first time you use PostgresSaver against a database, call checkpointer.setup() before anything else: with PostgresSaver.from_conn_string(DB_URI) as checkpointer: checkpointer.setup(). It creates the checkpoints tables; without it every read/write fails with "Undefined table checkpoints". You only need it once per database, so gate it behind a first-run flag.

## When to use

You are seeing this: LangGraph - Undefined table 'checkpoints' when using Postgres. Use this skill when you run into "Undefined table 'checkpoints' when using Postgres checkpointer".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

## Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

## Sources

- https://github.com/langchain-ai/langgraph/issues/2062
