I'm trying to do a connection to PostgreSQL 9.6 from Python 3.6 with Pycharm 2018.1.4 on Windows 10 with the connector psycopg2 in the version 2.7.5. I have the following code:
import os, psycopg2, psycopg2.extras
conexion = psycopg2.connect("dbname=Seguritec_BD user=SU host=localhost password=root port=5432")
psycopg2.OperationalError
cursor = conexion.cursor()
cursor.execute("Select * from Ejecutivos")
filas = cursor.fetchall()
It throws the next error:
Traceback (most recent call last):
File "D:/Documentos/Proyectos Pycharm/Graficos Drones/Login.py", line 3, in <module>
conexion = psycopg2.connect("dbname=Seguritec_BD user=SU host=localhost password=root port=5432")
File "D:\Documentos\Proyectos Python 3.5\lib\site-packages\psycopg2\__init__.py", line 130, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError
It's an empty OperationalError, there's no description of the error.
Can you help me to understand and fix this error, please?