try catch psycopg2.ProgrammingError code example Example: psycopg2 error $ pip install psycopg2-binary