Re: From spycopg2 to psycopg3 data adaptation

2021-10-05 Thread Daniele Varrazzo
On Tue, 5 Oct 2021 at 13:30, Paolo De Stefani wrote: > class TimestamptzQDateTimeLoader(Loader): > def load(self, value): > if value is None: > return None A `None` will never make it here: you can drop this check in psycopg 3. > BUT it's not working because the "val

From spycopg2 to psycopg3 data adaptation

2021-10-05 Thread Paolo De Stefani
Hi Still working on migration to psycopg3 of my (not so) small application... I use PyQt\PySide for user interface and i convert some postgresql data types to Qt types. For example to convert timestamptz to QDateTime in psycopg2 i use: def cast_timestamp_qdatetime(value, cur): if value is