Re: in BeginCopyTo make materialized view using COPY TO instead of COPY (query).

From: vignesh C <vignesh21(at)gmail(dot)com>
To: Kirill Reshke <reshkekirill(at)gmail(dot)com>
Cc: jian he <jian(dot)universality(at)gmail(dot)com>, Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Michael Paquier <michael(at)paquier(dot)xyz>
Subject: Re: in BeginCopyTo make materialized view using COPY TO instead of COPY (query).
Date: 2025-04-01 13:52:27
Message-ID: CALDaNm2OCk8kg6jeswYfCYTieAiO1RHe-D0ZxfL0XCV4dQ4YPA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 1 Apr 2025 at 15:49, Kirill Reshke <reshkekirill(at)gmail(dot)com> wrote:
>
> On Tue, 1 Apr 2025, 11:45 vignesh C, <vignesh21(at)gmail(dot)com> wrote:
>>
>>
>> One thing I noticed was that if the materialized view is not refreshed
>> user will get stale data
>>
>> Should we document this?
>
> Does this patch alter thus behaviour? User will get stale data even on HEAD, why should we take a care within this thread?

We are not changing the existing behavior. However, since copying data
from large tables can take a significant amount of time, would it be
helpful to add a cautionary note advising users to refresh the
materialized view before running copy command to avoid stale data?
This could prevent users from realizing the issue only after running
the copy operation, which would then require them to run it again. If
you think this is already obvious, then the note may not be necessary.

Regards,
Vignesh

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Melanie Plageman 2025-04-01 13:54:47 Re: Using read stream in autoprewarm
Previous Message Robert Haas 2025-04-01 13:49:12 Re: Better HINT message for "unexpected data beyond EOF"