Re: psycopg3 and cur.description behavior - Mailing list psycopg

From Daniele Varrazzo
Subject Re: psycopg3 and cur.description behavior
Date
Msg-id CA+mi_8bDaC10m4Bv5-huM_8Gajs-_4eX5VwMPy-L6XdatxRuKQ@mail.gmail.com
Whole thread Raw
In response to Re: psycopg3 and cur.description behavior  (Paolo De Stefani <paolo@paolodestefani.it>)
List 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 by date:

Previous
From: Paolo De Stefani
Date:
Subject: Re: psycopg3 and cur.description behavior
Next
From: Dan Davis
Date:
Subject: How to build statically on Windows