Linuxon szükség van két csomagra:
apt install python3-psycopg2 libpg-dev
python3 -m venv .venv
source ./venv/bin/activate
pip install psycopg2
import psycopg2 conn = psycopg2.connect(database="zoldzrt", host="localhost", user="zoldzrt", password="titok", port="5432") cur = conn.cursor() cur.execute("select * from employees") print(cur.fetchall()) cur.close()