Re: Q: limit the length of log file entries?

Поиск
Список
Период
Сортировка
Искать
От
Albrecht Dreß
Тема
Re: Q: limit the length of log file entries?
Дата
Msg-id
574OKSN4.CDETQIBQ.ZESIWSCX@VP6CMSVU.ANT6WK46.P2K35XKE
Ответ на
Список
Дерево обсуждения
Q: limit the length of log file entries? Albrecht Dreß <albrecht.dress@posteo.de>
Re: Q: limit the length of log file entries? Adrian Klaver <adrian.klaver@aklaver.com>
Re: Q: limit the length of log file entries? Albrecht Dreß <albrecht.dress@posteo.de>
Re: Q: limit the length of log file entries? Tom Lane <tgl@sss.pgh.pa.us>
Re: Q: limit the length of log file entries? Albrecht Dreß <albrecht.dress@posteo.de>
Re: Q: limit the length of log file entries? Adrian Klaver <adrian.klaver@aklaver.com>
Re: Q: limit the length of log file entries? Adrian Klaver <adrian.klaver@aklaver.com>
Re: Q: limit the length of log file entries? Albrecht Dreß <albrecht.dress@posteo.de>
Re: Q: limit the length of log file entries? Adrian Klaver <adrian.klaver@aklaver.com>
Am 04.09.25 20:21 schrieb(en) Adrian Klaver:
> > "Psycopg 3 sends the query and the parameters to the server separately, 
> > instead of merging them on the client side. Server-side binding works 
> > for normal SELECT and data manipulation statements (INSERT, UPDATE, 
> > DELETE), but it doesn’t work with many other statements. For instance, 
> > it doesn’t work with SET or with NOTIFY:"
> 
> As example:
> 
> import psycopg2
> import psycopg
> 
> conpsyc2 = psycopg2.connect("dbname=test user=postgres")
> conpsyc3 = psycopg.connect("dbname=test user=postgres")
> 
> cur2 = conpsyc2.cursor()
> cur3 = conpsyc3.cursor()
> 
> cur2.execute("select * from csv_test where id = %s", [1])
> cur3.execute("select * from csv_test where id = %s", [1])
> 
> yields:
> 
> --cur2
> 2025-09-04 11:17:30.246 PDT [29695] postgres@test LOG:  statement: BEGIN
> 2025-09-04 11:17:30.246 PDT [29695] postgres@test LOG:  statement: 
> select * from csv_test where id = 1
> 
> --cur3
> 2025-09-04 11:18:07.158 PDT [29703] postgres@test LOG:  statement: BEGIN
> 2025-09-04 11:18:07.159 PDT [29703] postgres@test LOG:  execute 
> : select * from csv_test where id = $1
> 2025-09-04 11:18:07.159 PDT [29703] postgres@test DETAIL:  Parameters: 
> $1 = '1'

Very nice example!  Looks as if the (anyway broken) script should be migrated to the the newer Python module – which, looking into the docs, shouldn't be too complex…

Thanks a lot for all your helpful insight,
Albrecht.
В списке pgsql-general по дате отправления
От: Adrian Klaver
Дата:
От: Adrian Klaver
Дата:
FAQ