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.96) (envelope-from ) id 1vuvGv-00D1kD-21 for pgsql-general@arkaria.postgresql.org; Tue, 24 Feb 2026 16:28:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vuvGt-0029du-1J for pgsql-general@arkaria.postgresql.org; Tue, 24 Feb 2026 16:28:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vuvGt-0029da-0H for pgsql-general@lists.postgresql.org; Tue, 24 Feb 2026 16:28:27 +0000 Received: from fhigh-a3-smtp.messagingengine.com ([103.168.172.154]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vuvGo-0000000154N-0qvv for pgsql-general@lists.postgresql.org; Tue, 24 Feb 2026 16:28:26 +0000 Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfhigh.phl.internal (Postfix) with ESMTP id D4A8814001D3; Tue, 24 Feb 2026 11:28:21 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-02.internal (MEProxy); Tue, 24 Feb 2026 11:28:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1771950501; x=1772036901; bh=HmaIAF180ch99ACUJIGI60JlzPctxl8YeBkty5zzfkA=; b= FeJ4URRYj0FfbXuIjaYP/5Mw19qDJdsgdXiFJJZ8RKOz76X1qBs4F2XkmlyB55hY +WNGAXAjQ2QNMhGMzUUAjMm0ABZQf/T7Ys9pmlLsrXqqhFoiXCLRmf0oyQvakfE8 vWBTpCjmTVDIMEdlBsuAqRoI7GRrHCy4qBdYCIA2sCeX68BUd/X+UdJgz/ahi/O1 eo+evOElcEU8fOTYI27f3InlQoHsNBLOtaBYNtv0TBnwh/a0cCQWNDQoS7Kz9VuX tfeLOG9OqelDhU1vA0w9VMst0vxESxsG9KAtLSE2WFXGYGg0oMTWlkvLkFgWAPbg f2uPgV68b0hRZBs0G95ccw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1771950501; x=1772036901; bh=H maIAF180ch99ACUJIGI60JlzPctxl8YeBkty5zzfkA=; b=R7An3xiBf+CubeOfX lHwUgi023D8XWpyMiFoQTymWwLpiQ/uvfuTLvTcR/uHFQktY42868WVLnWVmwdWk uhTz/MhzTwEXhOvdvdrkUuuBEDmXQfwcjSvwz/KTQe4fcTyRRodclmLkHA8r8gfx h9es5n26wMR9y2ZskjPOZZCwSVT7V0osiYFHdSJDGT/EzZHH5ZJdHaVtcqBl4trC +Bf8gqrzLgQUpWzpsvPIt/6fgML5wM/BI2lStGLI/AY1BYOpaARt3lUzmcIFnPEY MnUqW3F75C+/0NOTZMetr1FcOybNfE4GA2DWJGzpAXVFZIw2dEEBSJ9/luf6pnv2 T6tRA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvgedtieegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepkfffgggfuffvfhfhjggtgfesthekredttddvjeenucfhrhhomheptegurhhirghn ucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmqe enucggtffrrghtthgvrhhnpeekvdeutdehveetteehiedtfedugfduffdvgfffuefhffej ueeltddtfeeiffegudenucffohhmrghinhepghhithhhuhgsrdgtohhmpdhpohhsthhgrh gvshhqlhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhl fhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmpdhnsggprh gtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopeholhgvghdrughu shhhihhnsehpsghsqdhsohhfthifrghrvgdrtghomhdprhgtphhtthhopehpghhsqhhlqd hgvghnvghrrghlsehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 24 Feb 2026 11:28:21 -0500 (EST) Message-ID: Date: Tue, 24 Feb 2026 08:28:20 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Using COPY via pg_background extension To: Oleg Dushin , pgsql-general@lists.postgresql.org References: <001901dca5a8$6fdc2760$4f947620$@pbs-software.com> Content-Language: en-US From: Adrian Klaver In-Reply-To: <001901dca5a8$6fdc2760$4f947620$@pbs-software.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2/24/26 8:13 AM, Oleg Dushin wrote: > Hello everyone, > > I couldn't find anything on this topic in the mailing lists or in the > documentation for the ‘pg_background’ extension. > > https://github.com/vibhorkum/pg_background?tab=readme-ov-file#known- > limitations > > Perhaps I overlooked something. > > My question is: Is it possible to use the COPY protocol in combination > with pg_background? > > More specifically, is it possible to load data from a file into a table > via background worker process? > > COPY country FROM ‘/usr1/proj/bray/sql/country_data’; > > Would the following call or something similar be possible and achieve > the desired result?? > > pg_background_launch_v2(‘COPY country FROM ’/usr1/proj/bray/sql/ > country_data'); What happens when you try? Though be aware that COPY needs server user access to the file. If there is an error I would suggest reporting it here: https://github.com/vibhorkum/pg_background/issues > > https://www.postgresql.org/docs/current/sql-copy.html > > Kind regards, > > Oleg > -- Adrian Klaver adrian.klaver@aklaver.com