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 1s8lKi-00F6Vz-7Q for pgsql-general@arkaria.postgresql.org; Sun, 19 May 2024 18:32:33 +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 1s8lKi-00DqMc-73 for pgsql-general@arkaria.postgresql.org; Sun, 19 May 2024 18:32:32 +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 1s8lKh-00DqMU-So for pgsql-general@lists.postgresql.org; Sun, 19 May 2024 18:32:31 +0000 Received: from mail.appl-ecosys.com ([50.126.108.78]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s8lKe-0014Mh-Mu for pgsql-general@lists.postgresql.org; Sun, 19 May 2024 18:32:31 +0000 Received: from salmo.appl-ecosys.com (salmo.appl-ecosys.com [192.168.55.1]) by mail.appl-ecosys.com (Postfix) with ESMTP id 6690A2A43CF for ; Sun, 19 May 2024 11:32:27 -0700 (PDT) Date: Sun, 19 May 2024 11:32:27 -0700 (PDT) From: Rich Shepard To: pgsql-general@lists.postgresql.org Subject: Re: Updating 457 rows in a table In-Reply-To: <4001d2f9-1a70-47e5-9f21-754a5d7497bf@rodonnell.ie> Message-ID: <9753bd1a-6b25-b2ce-c2cc-aca258febb8@appl-ecosys.com> References: <164b3681-7a42-1e5-6a7b-80196ed33ded@appl-ecosys.com> <4001d2f9-1a70-47e5-9f21-754a5d7497bf@rodonnell.ie> MIME-Version: 1.0 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 Sun, 19 May 2024, Ray O'Donnell wrote: > Could you create a table with just person_id values whose rows are to be > updated? Then you could do something like this: > > update people set active = true where exists ( >   select 1 from temporary_table where person_id = people.person_id > ); > > That's just off the top of my head and might not be correct, but that's the > way I'd be thinking. Ray, I thought of doing this but it's a one-off activity. I would create and insert the table, then delete it when done. Will keep this in mind. Thanks, Rich