Re: Can psycopg2 copy_expert read from an io.StringIO() buffer?

Поиск
Список
Период
Сортировка
От Daniele Varrazzo
Тема Re: Can psycopg2 copy_expert read from an io.StringIO() buffer?
Дата
Msg-id CA+mi_8Yf6_cRgDjSuFt7px=g7=skjrx_73Pb3qBDwEiasEKgfQ@mail.gmail.com
обсуждение исходный текст
Ответ на Can psycopg2 copy_expert read from an io.StringIO() buffer?  (Jeff Ross <jross@openvistas.net>)
Ответы Re: Can psycopg2 copy_expert read from an io.StringIO() buffer?  (Jeff Ross <jross@openvistas.net>)
Список psycopg
Hello Jeff,

On Thu, 3 Nov 2022 at 21:15, Jeff Ross <jross@openvistas.net> wrote:

>         publisher_copy_cursor.copy_expert(copy_query,csv_buf,size)
>          subscriber_copy_cursor.copy_expert(insert_query,csv_buf)

Yes, StringIO works ok with copy_expert(). I think you need a
csv_buf.seek(0) between these two statements: after copying data in
the file, the file pointer will be at the end.

Cheers

-- Daniele



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

Предыдущее
От: Jeff Ross
Дата:
Сообщение: Can psycopg2 copy_expert read from an io.StringIO() buffer?
Следующее
От: Jeff Ross
Дата:
Сообщение: Re: Can psycopg2 copy_expert read from an io.StringIO() buffer?