File size: 379 Bytes
0bd4ab4
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import psycopg2
import sys

try:
    conn = psycopg2.connect("postgresql://user:onion123@127.0.0.1:5432/scoinvestigator")
    print("CONNECTION SUCESSFUL!")
    conn.close()
except psycopg2.OperationalError as e:
    print("OPERATIONAL ERROR DETAILS:")
    print(repr(e))
    print(e.pgerror)
    print(e.pgcode)
except Exception as e:
    print("OTHER ERROR:", type(e), str(e))