Re: Log Stacktrace of current Python Interpreter via PostgreSQL trigger

Поиск
Список
Период
Сортировка
От Daniele Varrazzo
Тема Re: Log Stacktrace of current Python Interpreter via PostgreSQL trigger
Дата
Msg-id CA+mi_8a5rij_5xchPkYPFS3moAtw9i6TrwKndynWfbJ=kFA4fg@mail.gmail.com
обсуждение исходный текст
Ответ на Log Stacktrace of current Python Interpreter via PostgreSQL trigger  (Thomas Güttler <guettliml@thomas-guettler.de>)
Ответы Re: Log Stacktrace of current Python Interpreter via PostgreSQLtrigger
Список psycopg
If you use postgres logging in stored procedures you can retrieve the logs in 'connection.notices'.


On Mon, 20 May 2019, 16:40 Thomas Güttler, <guettliml@thomas-guettler.de> wrote:
I am hunting a non reproducible in a production environment.

I can detect the buggy change in a postgres trigger.

Since it is production code I must no raise an exception. I can
only use logging.

If I could see the stacktrace of the python interpreter, I could
see which codes the change which I am hunting.

But how to get this interpreter stacktrace, if the condition is
detect in the db trigger?


https://stackoverflow.com/questions/51873708/log-stacktrace-of-python-in-postgresql-trigger

Maybe there is a psycopg2 feature which I don't know up to now.

I guess LISTEN+NOTIFY could get used.
Or setting a connection variable which I check after each SQL statement.

Ideas welcome,

   Thomas Güttler


--
Thomas Guettler http://www.thomas-guettler.de/
I am looking for feedback: https://github.com/guettli/programming-guidelines


В списке psycopg по дате отправления:

Предыдущее
От: Thomas Güttler
Дата:
Сообщение: Log Stacktrace of current Python Interpreter via PostgreSQL trigger
Следующее
От: Thomas Güttler
Дата:
Сообщение: Re: Log Stacktrace of current Python Interpreter via PostgreSQLtrigger