Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q5J56-0002Ju-1G for pgsql-general@arkaria.postgresql.org; Sat, 03 Jun 2023 04:41:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q5J53-0007MP-5k for pgsql-general@arkaria.postgresql.org; Sat, 03 Jun 2023 04:41:33 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q5J52-0007H1-KZ for pgsql-general@lists.postgresql.org; Sat, 03 Jun 2023 04:41:32 +0000 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1q5J4v-003MiD-R9 for pgsql-general@lists.postgresql.org; Sat, 03 Jun 2023 04:41:31 +0000 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-97460240863so225008066b.0 for ; Fri, 02 Jun 2023 21:41:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20221208.gappssmtp.com; s=20221208; t=1685767284; x=1688359284; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=sxD/p2L+niVEqDn2xwKFBbZ8jgfh3dSy2cHS0c9miSQ=; b=ZSs0oadZX9eLpjr70buXJvhFwZ9IsMDo4Yq1M9nwFY4DZakJVw1y1Rcsg+NuOhw88o IxLk4riNfiHYuA6lfKItpk/hlEIqsiLtAirOnf3c+cvA+cLrwv1hK9rD9NrIR+F18RoL m0h4o83wNQsFc42o8YUyPNJJwrZI2QDXT9TFJVxFLrSMRWZMg+g+Qj523hwR23SFp3z0 affFJ/vGKzxBvppvipC6mbVYrwbxJ+FgiyFEkhQEW/BEej1kMxPA69JFkTDqgN4iESW1 rlzNIsksMdmQ0phm6q50xiMJzQfdIQE0q8Sls1QM7y1w95iWZLJVojkHeqwEpAo9OT9T OJlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685767284; x=1688359284; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=sxD/p2L+niVEqDn2xwKFBbZ8jgfh3dSy2cHS0c9miSQ=; b=Hd68seSzQbrdrFdscJBzLbU44Ib/JC/+E8ppn9M+MEiXC/eCUuPi1CHpxyuUkC7FKV XlAiJLoQt7HGOzMYUe1LxhzWo7PqMrXaoJpDKgUQr2TTidCGmc2zFtxBuJotO7U0IwSl woploewnff4RLG0B/aPynomQlDQ6JHFrKSy3zjYdzWf2niDVgRcjcH+KuBRTOUUFsLnN qqH3eaiqFATKXTmun/z7z7z8wDI12wyD7kH5ajx0niumDsyIYqtU5UkY1n753CKPCjDy oYS3sMvRVSDGFoqmFgHM9CXdEW4gYrjheR8C6dUffw2pQggQMjy0SohZ+jdqam9ZSYoq NSQQ== X-Gm-Message-State: AC+VfDwRf0k9r/wQjN9ShQnxcxHBG0lYkN4bJYIxNh7yPjH9llMyIy4v 7+7W1MD1CtLY4ONkn5xqGMtoOIwxD5dtNMXmXmI= X-Google-Smtp-Source: ACHHUZ6eBTklJE4tT3T9S+wXrK+KMvJohS6wHWrTOheh85AMEHfS3i15OP13My/pi3yKAK+huXuUUg== X-Received: by 2002:a17:907:944f:b0:974:62d7:1467 with SMTP id dl15-20020a170907944f00b0097462d71467mr501333ejc.5.1685767283986; Fri, 02 Jun 2023 21:41:23 -0700 (PDT) Received: from localhost.localdomain (178-190-183-10.adsl.highway.telekom.at. [178.190.183.10]) by smtp.gmail.com with ESMTPSA id o9-20020a1709064f8900b0094e6a9c1d24sm1547678eju.12.2023.06.02.21.41.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jun 2023 21:41:23 -0700 (PDT) Message-ID: Subject: Re: custom background worker task for \copy? From: Laurenz Albe To: Joe Carlson , pgsql-general Date: Sat, 03 Jun 2023 06:41:22 +0200 In-Reply-To: <8407714E-65BB-40A8-97C8-EC4ACDB43B18@lbl.gov> References: <8407714E-65BB-40A8-97C8-EC4ACDB43B18@lbl.gov> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 (3.46.4-1.fc37) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 2023-06-02 at 11:36 -0700, Joe Carlson wrote: > I have SQL that does it with \copy (select * from where=E2=80=A6)= =E2=80=A6 And that is fine. > But it would be nice to be able to run the \copy commands in parallel. > So I was thinking of writing a background worker. Why don't you go the easy way of using several database connections to run = the parallel COPY statements? Yours, Laurenz Albe