import psycopg2
try:
connection = psycopg2.connect(host="localhost",
user="postgres",
password="password",
database="employee",
port="5432"
)
with connection.cursor() as curr:
curr.execute(
'SELECT version(): '
)
print(f'Server version: {curr.fetchone()}')
except:
print('Не могу подключиться')