Код: Выделить всё
SET lock_timeout TO '3s'
Код: Выделить всё
engine = create_engine('postgresql+psycopg2://{user}:{pswd}@{host}:{port}/{name}')
session = scoped_session(sessionmaker(bind=engine))
Код: Выделить всё
engine = create_engine(
'postgresql+psycopg2://{user}:{pswd}@{host}:{port}/{name}',
connect_args={'lock_timeout': 3}
)
Подробнее здесь: https://stackoverflow.com/questions/615 ... nd-psycopg