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 1tKJBJ-007yOT-VY for pgsql-sql@arkaria.postgresql.org; Sun, 08 Dec 2024 15:26:49 +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 1tKJBH-001l5w-9q for pgsql-sql@arkaria.postgresql.org; Sun, 08 Dec 2024 15:26:48 +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.94.2) (envelope-from ) id 1tKJBH-001l5o-0k for pgsql-sql@lists.postgresql.org; Sun, 08 Dec 2024 15:26:48 +0000 Received: from mail-oi1-x229.google.com ([2607:f8b0:4864:20::229]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tKJBF-001gcE-LG for pgsql-sql@lists.postgresql.org; Sun, 08 Dec 2024 15:26:47 +0000 Received: by mail-oi1-x229.google.com with SMTP id 5614622812f47-3eb40876bbfso149988b6e.0 for ; Sun, 08 Dec 2024 07:26:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733671604; x=1734276404; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=5b7EkpamMknbGNyQha7UbkFRpPhVC12ZmhqNxtYyPuY=; b=fGDKcTvoXA/T8A6carAuSBKv4NNl5ei5t1STM5Yg0GCUBsDl3cqmslBgbH8BD7OLii RU0Hkx/xWpAk8kD1eMjBkk0QUXibNeHcqEPPgSEQlMKVhRPu0lDQT2BYGwzfU22vuL73 RCy4ExeoOExV5hFxKorqsydWn2rb0q6kauMjyJCIDYbzDSoSMZVZW3laDhk+OBfyw6xV eUsUxswX484vbrWwPkzB83ZwpkreDM+ZHmVHCt90OqQrIwLgEwcgcPPyZ9gUxfAljrP1 4FtvUAulkuToN7tB+pcQdKh2748aPkMy3L/Jl8Ssx0OmZTEcdfJvsOtKtxVvuZLnmtUm ql3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733671604; x=1734276404; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5b7EkpamMknbGNyQha7UbkFRpPhVC12ZmhqNxtYyPuY=; b=gWsRISC40Hsj2svudozebIOtL96eKx2HWsoQLrFFvJKFDWe4pMeJWmsCYnhspYubVo p/Q8mNN+Vg8ylQB4ct6d5phyPYmg84FM7O7wZQqAK+DuLO8Jf4k97eu8RxBlHR43RqUf nXZbA0TukzovSBfNmyr3ntjwTie0PE9S8S+yDBKJmRSw2bVNpSUvmWqkKF4rAPfptrm5 PGTlmKCTjs3xcB+U3+BUzZ04ksMC9BsQZbiKu6viKf6fqsRcoT4Egqpzc54tkcYLfOYM w+vKwcjX9OnYV6icMRJN6mC1sApkmcGn8EgY/97enM7KivsykWrTgPBJkGKMqBaw0hUT FwVA== X-Gm-Message-State: AOJu0YyenNeMAgpeE7Xo3wzKJwNiwdnhsgY7mc7HeA3VZpX9LNA3xxBd CAloDelKyUQs7fi09xc5PuBVDUezUuPFwgteCJo02RBgumsdWEGAMcZYPae+UuyszPXBmw+LHto TBLJOHeyr3SsKTk3bN2wkiHKzU30= X-Gm-Gg: ASbGncu1En87JVs0t5wdiNODkkX44gYR9c0F9DgfjOVLpaY2SkasBLjJBqKawkHrHvQ vch8GKeOeZZ3Mtuw1XgyROlFSNRfpBWw= X-Google-Smtp-Source: AGHT+IFH335U3NVZyqpclhQ+kSkBPrPvaV9jkJILrrFgQKGzZbZqSAZX6Z259ScL8AIaV1EYM9u4Ehhovd+BsJLWN/A= X-Received: by 2002:a05:6808:1b24:b0:3e7:5af7:fa21 with SMTP id 5614622812f47-3eb19c43bc9mr6034034b6e.13.1733671604266; Sun, 08 Dec 2024 07:26:44 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a05:6802:3307:b0:577:9519:f64a with HTTP; Sun, 8 Dec 2024 07:26:43 -0800 (PST) In-Reply-To: References: From: "David G. Johnston" Date: Sun, 8 Dec 2024 08:26:43 -0700 Message-ID: Subject: Re: What is the best way to do this in Postgres To: kunwar singh Cc: "pgsql-sql@lists.postgresql.org" Content-Type: multipart/alternative; boundary="000000000000212e850628c3e053" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000212e850628c3e053 Content-Type: text/plain; charset="UTF-8" On Sunday, December 8, 2024, kunwar singh wrote: > > I know I can create a bash script or Python script , but I am wondering if > there is a smarter way to do it in Postgres? > > Your concurrency requirement makes doing it in the server quite difficult. Using anything that can launch multiple processes/threads and initiate one connect each is your best option. Many things can, so pick one you are familiar with. There is little complexity here that specialized tooling would be needed for. David J. --000000000000212e850628c3e053 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sunday, December 8, 2024, kunwar singh <krishsingh.111@gmail.com> wrote:

I know I can create a bash script or Python scrip= t , but I am wondering if there is a smarter way to do it in Postgres?


Your concurr= ency requirement makes doing it in the server quite difficult.=C2=A0 Using = anything that can launch multiple processes/threads and initiate one connec= t each is your best option.=C2=A0 Many things can, so pick one you are fami= liar with.=C2=A0 There is little complexity here that specialized tooling w= ould be needed for.

David J.=C2=A0
--000000000000212e850628c3e053--