Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1txW3X-00AXdf-O0 for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Mar 2025 19:04:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1txW3W-008hGQ-DN for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Mar 2025 19:04:50 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1txW3W-008hGF-3Y for pgsql-hackers@lists.postgresql.org; Wed, 26 Mar 2025 19:04:50 +0000 Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1txW3U-001I9x-0W for pgsql-hackers@postgresql.org; Wed, 26 Mar 2025 19:04:49 +0000 Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-30613802a6bso2416051fa.1 for ; Wed, 26 Mar 2025 12:04:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743015886; x=1743620686; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=LeVV8on2dIhzCrR0yKfKUa2ESqtHcy1wBwKHlzbtc3M=; b=Un985ZcnqEz9UeXsY6yVv/F17bNv8YUcO41eNmGTiGt9o005fg8yrlJ7zCVaAdgMB/ ueEgmoMPQzDbC86ZF7AlhRO6L+dNPY8hcbo0SArgy7BNacAD+0tCBnGDs7hz8xz+WafZ jM/byZN8nW253/A+KoUz8cDxXIqLXsPDCD5cI1YdxXi2pB9LfXCLpHyYql8sT41uwyZP grpoTuu8ecmxa/XuN4SkBJD/b8w0jdManfXyacBa4xc3CqkhcinlT5wB8qAu9g+jhYES fi1/+zK1qPfcQ9CR7bElZxogDYwFleXRvB7+QNVg5x+u29PFbd3rjXmtx+KPpCIMWdiy NM6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743015886; x=1743620686; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LeVV8on2dIhzCrR0yKfKUa2ESqtHcy1wBwKHlzbtc3M=; b=GdRaf9SOjUVidOTituUDevqZITe746qJXpKr96DnQtyFCCaCUl9+UdXavCah6VCSF4 qTfbI/CA7Ye76Teb4euDxRLEQNnEiZcJFffsjldff5cUKVrm4oYyul33ykItUqsGmFgy VppwgTyjgkEkkI+JtSSwFQLcGuyJYEP7blkQjFnY8PfON1hFx+zMfWDlNQYoGhwryadU nMDj1SPqT1CSf7PxlDpzhz1tE5vJhtNQNES8jYqO4Njnl3zMCOHUmUbdbhvDhagLfsZI qEmceaut0Vu5ZILAnsXeOopVQt3yxbm2cphCz4IeLpt+6L6R/ioZ4gGkTCNiN4ftLo7R WExg== X-Gm-Message-State: AOJu0Yyt6QiWu91JLA5iQkEUvOoIyyiGd1EqW5aez74kzkeY1Fc0QBqB S9N+IyyTquM6GwhnbhBxoso7J3xGK6SGqvgwDXE2lfNufr/N2N5X/sqON73C3YyaDSZHbYkamvq zZGphiOXRCVjLM8YIZBkbbPnV/oJjNg== X-Gm-Gg: ASbGncs0+Zwnnec+OnoCzpu/cM7vZqMRVyFIti0baZ8IAgaFVt75QKqSCsebYE5OImN uy1SWF4/LknViI2pvuFzaj0s09WNvsVuwD67ChDY21R6k/Tdevq4+vPSEf4IDKPFql0aMYYHFbR sXL0wDAt/g1uz1DJZLnkC4DpZNU7JAWHXufnlrsaoj X-Google-Smtp-Source: AGHT+IElkURrRBvcD66nv/n+bgVJEtYTtKVVWEs3+vyMj1Ux9eWyNELK0oP/+g5pxU7cNzlgqnksW2ZVSPVVnns1zjw= X-Received: by 2002:a05:651c:222c:b0:308:e54d:6195 with SMTP id 38308e7fff4ca-30dc5f2280fmr3578681fa.24.1743015885357; Wed, 26 Mar 2025 12:04:45 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Kirill Reshke Date: Thu, 27 Mar 2025 00:04:34 +0500 X-Gm-Features: AQ5f1JpTqMDzO9UTgMZgORje3UNXZqo4kdtkuskOjE0yPVwJf8c_VKEiXMCkJ3k Message-ID: Subject: Re: in BeginCopyTo make materialized view using COPY TO instead of COPY (query). To: jian he Cc: PostgreSQL-development , Tom Lane , Michael Paquier Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 28 Jan 2025 at 07:49, jian he wrote: > > On Mon, Jan 6, 2025 at 5:34=E2=80=AFPM jian he wrote: > > > > hi. > > > > about this issue, > > last email in 2012 (https://postgr.es/m/8967.1353167301@sss.pgh.pa.us) > > """ > > Even if it happens to be trivial in the current patch, it's an added > > functional requirement that we might later regret having cavalierly > > signed up for. And, as noted upthread, relations that support only > > one direction of COPY don't exist at the moment; that would be adding > > an asymmetry that we might later regret, too. > > > > regards, tom lane > > """ > > > > but now we have numerous COPY options that work solely in a single > > direction of COPY. > > I think now we can make some kind of relation (pg_class.relkind) that > > only works in one direction of COPY. > > hi. > patch attached. > also cc to Tom, > since at that time, you are against the idea of ``COPY matview TO``. Hi! With this patch it is possible to COPY matview TO, but not regular view, which is surprising. Let's fix that? --=20 Best regards, Kirill Reshke