Re: psycopg3 and cur.description behavior

Поиск
Список
Период
Сортировка
От Daniele Varrazzo
Тема Re: psycopg3 and cur.description behavior
Дата
Msg-id CA+mi_8bDaC10m4Bv5-huM_8Gajs-_4eX5VwMPy-L6XdatxRuKQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: psycopg3 and cur.description behavior  (Paolo De Stefani <paolo@paolodestefani.it>)
Список psycopg
On Sun, 3 Oct 2021 at 18:35, Paolo De Stefani <paolo@paolodestefani.it> wrote:

> By the way i didn't see any cur.mogrify() in psycopg 3 and no logging
> cursor as well something i used frequently
> Are they no more available ? Any plan to include them in next versions ?

There is no mogrify, no, because queries are not composed by the
client anymore, but they are sent to the server separately from the
arguments. Mogrify would be misleading because the same query might
behave differently if parameters are merged by the server or by the
client.

The logging cursor, I don't think should exist as an option: the
logging system itself has the option of being enabled or disabled. So,
if any, I think psycopg should log every query, let's say at info
level, which would normally be discarded, unless the user enables it
with a getLogger("psycopg").setLevel(logging.INFO). However that's not
in, because I have a fear (but not a measure) that it would add some
overhead. Which is totally premature optimisation, I am aware.

Maybe someone would like to help and get some measurement of how much
overhead does logging add? Comparing no logging/disabled
logging/enabled logging?

Cheers

-- Daniele



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

Предыдущее
От: Paolo De Stefani
Дата:
Сообщение: Re: psycopg3 and cur.description behavior
Следующее
От: Dan Davis
Дата:
Сообщение: How to build statically on Windows