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 1tE4ct-004xqb-Ng for pgsql-hackers@arkaria.postgresql.org; Thu, 21 Nov 2024 10:41:32 +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 1tE4cr-00EMHc-BU for pgsql-hackers@arkaria.postgresql.org; Thu, 21 Nov 2024 10:41:29 +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 1tE4cq-00EMHT-3d for pgsql-hackers@lists.postgresql.org; Thu, 21 Nov 2024 10:41:29 +0000 Received: from fout-a4-smtp.messagingengine.com ([103.168.172.147]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tE4cm-00325V-Hs for pgsql-hackers@postgresql.org; Thu, 21 Nov 2024 10:41:26 +0000 Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfout.phl.internal (Postfix) with ESMTP id 45BAD138014C; Thu, 21 Nov 2024 05:41:23 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Thu, 21 Nov 2024 05:41:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1732185683; x=1732272083; bh=n w6HwcF/b6S+7FNBBAslHOXGNvZxDgUR5eD3pMjtBkk=; b=xbI7aATk23Wr9tTB2 K4HKernybwzVNZfDYXj4dQsnW2/CvzAHBDk0e95K8UBz0h4fMs9wjiyNRaYDU67w fbjk1wrYirKYXQ8OAwrIhbPvxyROgsQEpfVSMFH/bhFUUWWaN3RcSkFzB5XqrzTI mIwDsHgkNlWbVLPniuskzE2YHO9B/OQLLWsf4N7qQt+nnM4cI0z47Q3v2RwkIWgS 7Z8kOTgnMDgKih832+xN39gLDCj52iAIVMtzdWknUPlnuuOR4MIZjlAKWLCprnJy VXY7IzhIAeCnoqVOu4ba12no8pvT0a8L2n0DLRb3GhDGYE4ShgSxDNWCYYs3pg4L Ksheg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrfeeigddujecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpeffhffvvefukfggtggugfgjsehmkeerredttdejnecu hfhrohhmpeetlhhvrghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrd hnohdqihhprdhorhhgqeenucggtffrrghtthgvrhhnpeduleekkefgtddttedtkefguddv ieffleetgeejiefhteehkeevfeettdduvdfhueenucffohhmrghinhepvghnthgvrhhprh hishgvuggsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghi lhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrghdpnhgspghrtg hpthhtohepgedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepkhhouhestghlvggr rhdqtghouggvrdgtohhmpdhrtghpthhtohepshgrfigruggrrdhmshhhkhesghhmrghilh drtghomhdprhgtphhtthhopehmihgthhgrvghlsehprghquhhivghrrdighiiipdhrtghp thhtohepphhgshhqlhdqhhgrtghkvghrshesphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 21 Nov 2024 05:41:22 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1732185679; bh=PGNM3q4QLzq+1jeNditpQHpKG8bHhRAxS60+DvLZkJA=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=c02tFtB7OvWwqurqmQiR4FCPanMlp8/5/LeH4V5MTbOXW+6wjR1auEG/jV/zmmw9x bZ82BAt8uCTWSOYR6esgnd2EeDfG10CP55USAIcu7txQjHwxDPOAZJIYsdh9aN8u1C CRIj5yCmvnPwh1559Tps3xplSJF1PgLPd8669l/q7B7+07wZko2ypeXhBlOb+RGeCR ByD5cARJ1Rsv8blED6JLUvXGcQC/KxGxzfAPzuS3MegJmVAOfK2empvo6G3gElGnt9 E1lJ7zXnFrD8AfiFgob+kOcUT9+L/MdX8WYllr5NTNsD8+Y7fr8JfwsN79+N+FaDsb XaP3lAwiRCeAw== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id F33E9E3; Thu, 21 Nov 2024 11:41:18 +0100 (CET) Date: Thu, 21 Nov 2024 11:41:18 +0100 From: Alvaro Herrera To: Masahiko Sawada Cc: Sutou Kouhei , michael@paquier.xyz, pgsql-hackers@postgresql.org Subject: Re: Make COPY format extendable: Extract COPY TO format implementations Message-ID: <202411211041.v25vlwo2uvjr@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="6kdknh3fv3zn7jom" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --6kdknh3fv3zn7jom Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit I ran `make headerscheck` after these patches and it reported a few problems: /pgsql/source/master/src/tools/pginclude/headerscheck /pgsql/source/master /pgsql/build/master In file included from /tmp/headerscheck.xdG40Y/test.c:2: /pgsql/source/master/src/include/commands/copyapi.h:76:44: error: unknown type name ‘CopyFromState’; did you mean ‘CopyToState’? 76 | void (*CopyFromInFunc) (CopyFromState cstate, Oid atttypid, | ^~~~~~~~~~~~~ | CopyToState /pgsql/source/master/src/include/commands/copyapi.h:87:43: error: unknown type name ‘CopyFromState’; did you mean ‘CopyToState’? 87 | void (*CopyFromStart) (CopyFromState cstate, TupleDesc tupDesc); | ^~~~~~~~~~~~~ | CopyToState /pgsql/source/master/src/include/commands/copyapi.h:98:44: error: unknown type name ‘CopyFromState’; did you mean ‘CopyToState’? 98 | bool (*CopyFromOneRow) (CopyFromState cstate, ExprContext *econtext, | ^~~~~~~~~~~~~ | CopyToState /pgsql/source/master/src/include/commands/copyapi.h:102:41: error: unknown type name ‘CopyFromState’; did you mean ‘CopyToState’? 102 | void (*CopyFromEnd) (CopyFromState cstate); | ^~~~~~~~~~~~~ | CopyToState /pgsql/source/master/src/include/commands/copyapi.h:103:1: warning: no semicolon at end of struct or union 103 | } CopyFromRoutine; | ^ I think the fix should be the attached. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "In Europe they call me Niklaus Wirth; in the US they call me Nickel's worth. That's because in Europe they call me by name, and in the US by value!" --6kdknh3fv3zn7jom Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="copy-headersfix.patch" diff --git a/contrib/file_fdw/file_fdw.c b/contrib/file_fdw/file_fdw.c index 9e2896f32ae..bac31315fcb 100644 --- a/contrib/file_fdw/file_fdw.c +++ b/contrib/file_fdw/file_fdw.c @@ -21,7 +21,6 @@ #include "access/table.h" #include "catalog/pg_authid.h" #include "catalog/pg_foreign_table.h" -#include "commands/copy.h" #include "commands/copyfrom_internal.h" #include "commands/defrem.h" #include "commands/explain.h" diff --git a/src/backend/commands/copyfromparse.c b/src/backend/commands/copyfromparse.c index 5416583e94d..f80bdd5ed4e 100644 --- a/src/backend/commands/copyfromparse.c +++ b/src/backend/commands/copyfromparse.c @@ -62,7 +62,6 @@ #include #include -#include "commands/copy.h" #include "commands/copyfrom_internal.h" #include "commands/progress.h" #include "executor/executor.h" diff --git a/src/backend/commands/copyto.c b/src/backend/commands/copyto.c index 73b9ca44577..345ba48c3f9 100644 --- a/src/backend/commands/copyto.c +++ b/src/backend/commands/copyto.c @@ -19,7 +19,6 @@ #include #include "access/tableam.h" -#include "commands/copy.h" #include "commands/copyapi.h" #include "commands/progress.h" #include "executor/execdesc.h" diff --git a/src/include/commands/copyapi.h b/src/include/commands/copyapi.h index ff269def9dc..4c3413841ae 100644 --- a/src/include/commands/copyapi.h +++ b/src/include/commands/copyapi.h @@ -14,12 +14,10 @@ #ifndef COPYAPI_H #define COPYAPI_H +#include "commands/copy.h" #include "executor/tuptable.h" #include "nodes/execnodes.h" -/* This is private in commands/copyto.c */ -typedef struct CopyToStateData *CopyToState; - /* * API structure for a COPY TO format implementation. Note this must be * allocated in a server-lifetime manner, typically as a static const struct. diff --git a/src/include/commands/copyfrom_internal.h b/src/include/commands/copyfrom_internal.h index 55fe24d7284..1ca058c6add 100644 --- a/src/include/commands/copyfrom_internal.h +++ b/src/include/commands/copyfrom_internal.h @@ -14,7 +14,6 @@ #ifndef COPYFROM_INTERNAL_H #define COPYFROM_INTERNAL_H -#include "commands/copy.h" #include "commands/copyapi.h" #include "commands/trigger.h" #include "nodes/miscnodes.h" --6kdknh3fv3zn7jom--