From oleg.dushin@pbs-software.com Tue Feb 24 16:13:15 2026 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 1vuv1y-00CrQP-2i for pgsql-general@arkaria.postgresql.org; Tue, 24 Feb 2026 16:13:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vuv1x-001whQ-2U for pgsql-general@arkaria.postgresql.org; Tue, 24 Feb 2026 16:13:01 +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.96) (envelope-from ) id 1vuv1x-001wgo-1Q for pgsql-general@lists.postgresql.org; Tue, 24 Feb 2026 16:13:01 +0000 Received: from arena.pbs-software.com ([87.193.216.233]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vuv1u-00000000yv4-0C4S for pgsql-general@lists.postgresql.org; Tue, 24 Feb 2026 16:13:00 +0000 Received: from hermes.int.pbs-software.com (hermes.int.pbs-software.com [172.25.2.48]) by arena.pbs-software.com (Postfix) with ESMTPS id 51AABA04EA for ; Tue, 24 Feb 2026 17:13:15 +0100 (CET) Received: from LAP78 (unknown [172.23.9.109]) by hermes.int.pbs-software.com (Postfix) with ESMTPS id 664D1E0666 for ; Tue, 24 Feb 2026 17:12:56 +0100 (CET) From: "Oleg Dushin" To: Subject: Using COPY via pg_background extension Message-ID: <001901dca5a8$6fdc2760$4f947620$@pbs-software.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_001A_01DCA5B0.D1A08F60" X-Mailer: Microsoft Outlook 16.0 Thread-Index: AdylqDSSvm++ZslMQdW8hubdK0C5Jw== Content-Language: de Date: Tue, 24 Feb 2026 17:13:15 +0100 X-Scanned-By: MIMEDefang 2.84 on 172.22.1.233 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multipart message in MIME format. ------=_NextPart_000_001A_01DCA5B0.D1A08F60 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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-limitati ons 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'); https://www.postgresql.org/docs/current/sql-copy.html Kind regards, Oleg ------=_NextPart_000_001A_01DCA5B0.D1A08F60 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

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=3Dreadme-ov-f= ile#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');

 

https://www.postgresql.org/docs/current/sql-copy.html

 

Kind regards,

 

Oleg

------=_NextPart_000_001A_01DCA5B0.D1A08F60-- From adrian.klaver@aklaver.com Tue Feb 24 16:28:20 2026 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 From ronljohnsonjr@gmail.com Tue Feb 24 19:21:39 2026 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 1vuxym-00EwMV-2a for pgsql-general@arkaria.postgresql.org; Tue, 24 Feb 2026 19:21:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vuxyk-0037IY-1g for pgsql-general@arkaria.postgresql.org; Tue, 24 Feb 2026 19:21:54 +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 1vuxyk-0037IQ-0g for pgsql-general@lists.postgresql.org; Tue, 24 Feb 2026 19:21:54 +0000 Received: from mail-ot1-x331.google.com ([2607:f8b0:4864:20::331]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vuxyh-000000016Ml-0gc8 for pgsql-general@postgresql.org; Tue, 24 Feb 2026 19:21:53 +0000 Received: by mail-ot1-x331.google.com with SMTP id 46e09a7af769-7d4c7d04890so5498183a34.3 for ; Tue, 24 Feb 2026 11:21:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1771960910; cv=none; d=google.com; s=arc-20240605; b=aoBFSWsfvxOLOXpljaotv8jqnUX5DZh55kQQFHQU+eXgomktjDoyAPLctmT+9Nu+yA uyqqtuyW5FM+ynrmpvaCMzS9jcghs6w9rdM3qXRtx2FlYjhtWzDp/9Wq085lz1pxEewQ OTI6bC0h1ksgsvf/NWMl/sX8u92dc85WLmd/ovi1bFd+ajYQ0O5QCJO1PIB/v3h64wNI rvhtRfOymDvv4gb/NplG3QjcwUBFjUwc5bWre2iF45vHpOZoGLwiEqaeMsPfFO8ZRK2t 58m/Lip0/77TCDz5lLmO7i1a2WR9bM+gHPf860Ox1DT4XOXBbIzCjKeOTIXIKV4Y1M/N tOJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=X/oboWoKhHzKGQpE+kdBbExunUsownj/HiJ4+zaimek=; fh=KNSq+t9BltSXFnT3Yof/aKGBtqxeA+bTALiYdvTslaY=; b=RB+KL6HRVhy4CIK81xbj1irEMwD6NGcbqU2UswbCEtJr4DX9/m868PIs6Iq+bnEREN kLP//APe/+UEMK+vKtI4MdjXQrQ7B+4nssdNN9BmvzpUdj00/8ZglzuXPdhfOHCfyCqg R+IOjy4KxhDbXH47mFMiYtwvT/H2EmuD7bSPSwfBIefFBlDnoXjoS1QtAV7R6k48+Hk1 An8s4MhwEIxqGOEdnWQGjaY89eFl0/QYpbB3JUISyEuL+w5RCC3JMCEnapsjDlIHquu8 ewB4eudZYjvFJUkc1nyqLVPRoK8LXtfFUy1q8T0WGZKFd9ChuWz1iw7zr8Eu1H8bsMKU vaog==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771960910; x=1772565710; darn=postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=X/oboWoKhHzKGQpE+kdBbExunUsownj/HiJ4+zaimek=; b=S0O3UOuoDECIeHtAUM7E9gfIi095zGLcwlO5VlVfTbtJSoNrefSqvNBjxvi4uSFEOX eK6JX3tw45n3t6mCmZFP8WwVFe6AGeToKW/dUz9wMaJtCR7KBeYpuc1nL30kNPTIxsyv 6a1QfXH8agJGLAhBBxZMyiySB1MvHPKDEBl+bM/pUtu9MSajVV/Ha8luJoWnlR43jrMV 3WBAm2VOPjg7ZaPbHllrS94Q/kGFP06oDV2JggRCST9h09HIcx0bcsdTPFTrG7T+WAwQ Q370Ckt+3pJlVe6MKLMYmApg2pUTjdshYRsINW2S/5u/B1WbAFm87Oy6IbbXyznU3iZV 80pA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771960910; x=1772565710; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=X/oboWoKhHzKGQpE+kdBbExunUsownj/HiJ4+zaimek=; b=V4cEF2n3uTHl2EbV86yu3lWXRgM+l3aA7QS68yK23LBIdv+i5ot51e5HtatIYkQAGi g8NI3p8Wrq+1OKexj3BHn5f2Xp61rNsb3QR/+yOu2vV4X197ZzeVN5c/BcmZfCynCWg+ 1iZ8s77ZhE174/L2RCjnW+xvOvRmWzEzUu/8z/H+wz2/84x0xcZMib8g/vpBdWiA+gvZ wd1XZyMUMxt/e0nwRTmEeaazx1NLe21aqmAzX2zga/6q8uolFBMBLuuDL/OdUT33hj44 vPraUw8izYAPZahk1s0WzKgwrsdiPzgoOTnu8A3hhSANVRiwS3ModtB3WP9SrgCL8EhR FlpQ== X-Gm-Message-State: AOJu0YyIItrjmbYUHlkgmEpqIb0+/4ADf0Ex5i3tBKS33GZLz8XB3+DX Ld2OSqYdfHa1ZWSr1/JHGIRTfLqPLakIZJHVNtuHuiKslWSMvk8LC34uIFhpw9l6YQ3Phv7UG2F Ih35sdRmkwImrYTDDbjBQEIRR7uLP6DBYtA== X-Gm-Gg: AZuq6aLuuWW8SWO54CW0zwaTb6nGxORWiORII62nvh5MxRJkxPU81Kjtq4VQXbai/VR DlKmuNRWW/fYydI0rhUBG8bzZiNjP6UDGkSeIL4wQTvKHNsONPqjDcYeI1de91mkn2e4qJjDDtc txG3EwR3KZCPdMy+HdpCQ4GaePcE04oHhyPaNg/YkVSRKgi5bJy/71jmiQr7qwtTj1FpzxkgHRX WKuNX2LvlTmKApKvcW7i0x3cy3Zf3SAHuo6tCtr5/s+V3gTNa7DGwZCy0P3og45SQcZsUnIwnPo wK9Z3GIX7NJ7lcd5Rog= X-Received: by 2002:a05:6820:3088:b0:66e:e7e:6524 with SMTP id 006d021491bc7-679c4507c9fmr6185059eaf.58.1771960910169; Tue, 24 Feb 2026 11:21:50 -0800 (PST) MIME-Version: 1.0 References: <001901dca5a8$6fdc2760$4f947620$@pbs-software.com> In-Reply-To: <001901dca5a8$6fdc2760$4f947620$@pbs-software.com> From: Ron Johnson Date: Tue, 24 Feb 2026 14:21:39 -0500 X-Gm-Features: AaiRm513cpQ9O6eXNOQx3xMvM582CLEZ7iAnjvufSM1kKEk8PZc7uB9WyG5RQUU Message-ID: Subject: Re: Using COPY via pg_background extension To: pgsql-general Content-Type: multipart/alternative; boundary="0000000000009b4a07064b96cc9e" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000009b4a07064b96cc9e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Feb 24, 2026 at 11:13=E2=80=AFAM Oleg Dushin wrote: > Hello everyone, > > > > I couldn't find anything on this topic in the mailing lists or in the > documentation for the =E2=80=98pg_background=E2=80=99 extension. > > > > > https://github.com/vibhorkum/pg_background?tab=3Dreadme-ov-file#known-lim= itations > > > > Perhaps I overlooked something. > > > > My question is: Is it possible to use the COPY protocol in combination > with pg_background? > Would "psql run from crontab" serve your purpose just as well? --=20 Death to , and butter sauce. Don't boil me, I'm still alive. lobster! --0000000000009b4a07064b96cc9e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Tue, Feb 24, 2026 at 11:13=E2=80=AFAM = Oleg Dushin <oleg.dushin= @pbs-software.com> wrote:

Hello everyone,

=C2=A0

I couldn't find anything on this topic= in the mailing lists or in the documentation for the =E2=80=98pg_backgroun= d=E2=80=99 extension.

=C2=A0

https://github.com/vibh= orkum/pg_background?tab=3Dreadme-ov-file#known-limitations

=C2=A0

Perhaps I overlooke= d something.

=C2=A0

My question is: Is it possible to use the COPY protocol in combinati= on with pg_background?

=
Would "psql run from crontab" serve your=C2=A0purp= ose just as well?

--
Death to <Redacted>, and butter sauce.
Don't boil me, I'= m still alive.
<Redacted> lobster!
--0000000000009b4a07064b96cc9e--