Re: Reporting UnicodeEncodeError info on arbitrary data sent to PG with psycopg3

2024-02-14 Thread Daniele Varrazzo
Hello Karl, On Wed, 14 Feb 2024 at 02:37, Karl O. Pinc wrote: > This does not work. What is wrong with what I'm doing > and how do I do what I want? (And how am I supposed to > know why this does not work and what works?) I call the > dumper because I want to rely on psycopg3's mechanisms > a

Re: Reporting UnicodeEncodeError info on arbitrary data sent to PG with psycopg3

2024-02-14 Thread Karl O. Pinc
Hi Daniele, On Wed, 14 Feb 2024 15:30:33 +0100 Daniele Varrazzo wrote: > Note however that if you just want to know the Python codec you can > find it in `conn.info.encoding` > (https://www.psycopg.org/psycopg3/docs/api/objects.html#psycopg.ConnectionInfo.encoding): > > >>> conn.info.encodi

Re: Reporting UnicodeEncodeError info on arbitrary data sent to PG with psycopg3

2024-02-14 Thread Daniele Varrazzo
Hello, On Wed, 14 Feb 2024 at 16:42, Karl O. Pinc wrote: > I did not use conn.info.encoding because the docs say that it > contains the _client_ encoding, not the server-side encoding > used to store the db content. > [...] > Confirming the encodings, connecting to the "latin1" db with psql sho