# The PostgreSQL reader without table access

A reporting role connects to the database but cannot read its required table.
Find the missing privilege and restore read access without changing the data,
table ownership, role membership or write privileges.

## Before you begin

Use a disposable machine with Bash, Python 3, Docker and Docker Compose.
The lab creates `breakfix-dbops-04`, an internal Docker network and a named
database volume. It publishes no host ports and creates no cloud resources.
Docker may download PostgreSQL 17. Authentication is intentionally insecure;
never use these settings or this project name for real workloads. Other users
with Docker access can reach the lab database.

Setup refuses existing project resources. Teardown checks container ownership
before deleting the lab containers, network and synthetic database volume.

## Investigate

```sh
./setup.sh
docker compose -p breakfix-dbops-04 exec db psql -X -U lab_reader -d lab -c 'SELECT * FROM public.report ORDER BY id'
docker compose -p breakfix-dbops-04 exec db psql -X -U lab_admin -d lab
```

Inspect the `lab_reader` role and `public.report` privileges. Preserve the
reader's existing database and schema access and use the least privilege
needed for the report. Do not grant access to `PUBLIC` or change the data.
Run `./verify.sh` after repair and `./teardown.sh` when finished.
Verification reads the data as the reader and checks that write, ownership,
role and broader administrative privileges remain absent.
