This file captures the issues and recovery steps documented during the lab workflow.
(venv) toor@ip-172-31-10-184:~$ sudo systemctl status postgresql● postgresql.service - PostgreSQL RDBMS
Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled; preset: enabled)
Active: active (exited) since Sun 2026-04-12 17:39:58 UTC; 2min 14s ago
Main PID: 4121 (code=exited, status=0/SUCCESS)
CPU: 2ms
Apr 12 17:39:58 ip-172-31-10-184 systemd[1]: Starting postgresql.service - PostgreSQL RDBMS...
Apr 12 17:39:58 ip-172-31-10-184 systemd[1]: Finished postgresql.service - PostgreSQL RDBMS.
(venv) toor@ip-172-31-10-184:~$ sudo systemctl restart postgresql(venv) toor@ip-172-31-10-184:~$ sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'labpassword';"ALTER ROLE
If using virtual environment:
toor@ip-172-31-10-184:~$ source venv/bin/activate
(venv) toor@ip-172-31-10-184:~$ pip install psycopg2-binaryRequirement already satisfied: psycopg2-binary in ./venv/lib/python3.12/site-packages (2.9.10)
If not using a virtual environment:
toor@ip-172-31-10-184:~$ pip3 install --user psycopg2-binaryCollecting psycopg2-binary
Using cached psycopg2_binary-2.9.10-cp312-cp312-manylinux_2_17_x86_64.whl
Installing collected packages: psycopg2-binary
Successfully installed psycopg2-binary-2.9.10
(venv) toor@ip-172-31-10-184:~$ sudo -u postgres psql -d job_registry -c "GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO postgres;"GRANT
(venv) toor@ip-172-31-10-184:~$ sudo -u postgres psql -d job_registry -c "SELECT COUNT(*) FROM jobs;" count
-------
2
(1 row)