PostgreSQL queries: Speed and safety
The main psycopg2 difference from sqlite3 is placeholder syntax. Instead of ? you use %s. This is not Python’s % formatting — the driver handles types, escaping, and injection safety.
The main psycopg2 difference from sqlite3 is placeholder syntax. Instead of ? you use %s. This is not Python’s % formatting — the driver handles types, escaping, and injection safety.