Re: bug: copy progress reporting of backends which run multiple COPYs

From: Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>
To: Ted Yu <yuzhihong(at)gmail(dot)com>
Cc: Justin Pryzby <pryzby(at)telsasoft(dot)com>, Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, Josef Šimánek <josef(dot)simanek(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: bug: copy progress reporting of backends which run multiple COPYs
Date: 2023-01-21 01:22:12
Message-ID: CAEze2Whp9GVuU1rXS9fAx7TeLxyU=nLda_eJkQ7Y5SUc+R59_w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, 21 Jan 2023 at 02:04, Ted Yu <yuzhihong(at)gmail(dot)com> wrote:
>
>
>
> On Fri, Jan 20, 2023 at 4:51 PM Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com> wrote:
>>
>> Attached a patch that solves this specific issue in a
>> binary-compatible way. I'm not super happy about relying on behavior
>> of callers of BeginCopyFrom (assuming that users that run copy
>> concurrently will not provide a ParseState* to BeginCopyFrom), but it
>> is what it is.
>
> Is it possible to check range_table / rteperminfos so that we don't introduce the bool field ?

I think yes, but I'm not sure we can depend on rteperminfos to be set,
and the same for p_rtable. I also don't think it's a good idea for
code clarity: there is no good reason why the (un)availability of
either range_table or rteperminfos would allow progress reporting - it
would require additional extensive documentation around both the usage
sites and the field itself. Adding a well-named field provides a much
better experience in my opinion.

If someone were opposed to adding that field in backbranches I'm fine
with using one of these instead, assuming additional clear
documentation is added as well.

- Matthias

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2023-01-21 01:28:02 Re: bug: copy progress reporting of backends which run multiple COPYs
Previous Message Andres Freund 2023-01-21 01:12:37 libpqrcv_connect() leaks PGconn