libpq: How to cancel a COPY ... TO statement?

2021-11-08 Thread Daniel Frey
Hi, after sending a COPY ... TO statement with PQsendQuery(), how can I cancel it properly? I tried using PQcancel(), but it seems to have no effect. Calling PQgetCopyData() or PQgetResult() afterwards does not go into a failure state. And I don't want to call PQgetCopyData() until it returns

Re: PQexecParams, placeholders and variable lists of params

2021-11-23 Thread Daniel Frey
On 23. Nov 2021, at 16:43, Tom Lane wrote: > PG's array quoting rules are odd enough that I can sympathize with not > wanting to deal with them. (Although, if you only have to build an > array and not parse one, taking the always-quote-even-if-not-necessary > approach makes it easier.) > > I do

libpq: Which functions may hang due to network issues?

2021-12-03 Thread Daniel Frey
I need to know which functions of libpq may "hang", depending on network issues. For some functions is seems to be clear, as they only work locally, other functions are clearly documented to wait on some network interaction. But for some functions, it is unclear on whether they are guaranteed to

Re: libpq: Which functions may hang due to network issues?

2021-12-03 Thread Daniel Frey
> On 3. Dec 2021, at 17:00, Laurenz Albe wrote: > > On Fri, 2021-12-03 at 11:37 +0100, Daniel Frey wrote: >> I need to know which functions of libpq may "hang", depending on network >> issues. For some functions is >> seems to be clear, as they only work

Re: libpq: Which functions may hang due to network issues?

2021-12-03 Thread Daniel Frey
> On 3. Dec 2021, at 18:14, Tom Lane wrote: > > Daniel Frey writes: >>> On 3. Dec 2021, at 17:00, Laurenz Albe wrote: >>> On Fri, 2021-12-03 at 11:37 +0100, Daniel Frey wrote: >>>> Is there a complete list of methods that might wait for network >>

Re: libpq: Which functions may hang due to network issues?

2021-12-05 Thread Daniel Frey
> On 4. Dec 2021, at 22:43, Laurenz Albe wrote: > > On Fri, 2021-12-03 at 21:33 +0100, Daniel Frey wrote: >> But the real issue, at least for me, is PQfinish(). Considering that my >> application is not >> allowed to hang (or crash, leak, ...), what should I do in c

Re: libpq: Which functions may hang due to network issues?

2021-12-05 Thread Daniel Frey
> On 5. Dec 2021, at 17:01, Tom Lane wrote: > > Daniel Frey writes: >> With all that said, I think that PostgreSQL/libpq should have a clear, >> documented way to get rid of a connection that is guaranteed to not hang. It >> has something similar for almost all

Re: libpq: Which functions may hang due to network issues?

2021-12-06 Thread Daniel Frey
On 5. Dec 2021, at 21:32, Daniel Frey wrote: > >> On 5. Dec 2021, at 17:01, Tom Lane wrote: >> >> Daniel Frey writes: >>> With all that said, I think that PostgreSQL/libpq should have a clear, >>> documented way to get rid of a connection that is guaran

Re: Pipeline Mode vs Single Row Mode / Chunked Rows Mode

2025-01-07 Thread Daniel Frey
> On 6. Jan 2025, at 20:47, Daniel Verite wrote: > > Daniel Frey wrote: > >> I tried to understand the interaction between Pipeline Mode and >> Single Row Mode / Chunked Rows Mode. It seems that it works >> sometimes, but I don't get the feeling that it w

Pipeline Mode vs Single Row Mode / Chunked Rows Mode

2024-12-19 Thread Daniel Frey
Hi, I'm adding support for Pipeline Mode to my C++ PostgreSQL client library (https://github.com/taocpp/taopq) and I tried to understand the interaction between Pipeline Mode and Single Row Mode / Chunked Rows Mode. It seems that it works sometimes, but I don't get the feeling that it was delib