public inbox for [email protected]  
help / color / mirror / Atom feed
From: Fujii Masao <[email protected]>
To: [email protected]
Subject: pgsql: Allow "COPY table TO" command to copy rows from materialized vie
Date: Fri, 04 Apr 2025 10:33:00 +0000
Message-ID: <[email protected]> (raw)

Allow "COPY table TO" command to copy rows from materialized views.

Previously, "COPY table TO" command worked only with plain tables and
did not support materialized views, even when they were populated and
had physical storage. To copy rows from materialized views,
"COPY (query) TO" command had to be used, instead.

This commit extends "COPY table TO" to support populated materialized
views directly, improving usability and performance, as "COPY table TO"
is generally faster than "COPY (query) TO". Note that copying from
unpopulated materialized views will still result in an error.

Author: jian he <[email protected]>
Reviewed-by: Kirill Reshke <[email protected]>
Reviewed-by: David G. Johnston <[email protected]>
Reviewed-by: Vignesh C <[email protected]>
Reviewed-by: Fujii Masao <[email protected]>
Discussion: https://postgr.es/m/CACJufxHVxnyRYy67hiPePNCPwVBMzhTQ6FaL9_Te5On9udG=yg@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/534874fac0b34535c9a5ab9257d6574f78423578

Modified Files
--------------
doc/src/sgml/ref/copy.sgml         | 20 ++++++++++----------
src/backend/commands/copyto.c      | 13 ++++++++-----
src/test/regress/expected/copy.out | 12 ++++++++++++
src/test/regress/sql/copy.sql      |  9 +++++++++
4 files changed, 39 insertions(+), 15 deletions(-)



reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: pgsql: Allow "COPY table TO" command to copy rows from materialized vie
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox