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 1s8lPv-00F703-CG for pgsql-general@arkaria.postgresql.org; Sun, 19 May 2024 18:37:56 +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 1s8lPu-00Dzwn-Te for pgsql-general@arkaria.postgresql.org; Sun, 19 May 2024 18:37: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.94.2) (envelope-from ) id 1s8lPu-00DztY-I7 for pgsql-general@lists.postgresql.org; Sun, 19 May 2024 18:37:54 +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 1s8lPr-0014QC-8B for pgsql-general@lists.postgresql.org; Sun, 19 May 2024 18:37:53 +0000 Received: from salmo.appl-ecosys.com (salmo.appl-ecosys.com [192.168.55.1]) by mail.appl-ecosys.com (Postfix) with ESMTP id 521FB2A43CF for ; Sun, 19 May 2024 11:37:50 -0700 (PDT) Date: Sun, 19 May 2024 11:37:50 -0700 (PDT) From: Rich Shepard To: pgsql-general@lists.postgresql.org Subject: Re: Updating 457 rows in a table In-Reply-To: <372F0968-BD78-45EB-AE70-015DBF923EBC@thebuild.com> Message-ID: <7e82178c-1249-b592-bfea-5152563ceb4c@appl-ecosys.com> References: <164b3681-7a42-1e5-6a7b-80196ed33ded@appl-ecosys.com> <1E14886A-BBCB-40E4-8231-1159D12BD261@thebuild.com> <98639d1a-dddf-38e3-49b3-63632136a0f@appl-ecosys.com> <372F0968-BD78-45EB-AE70-015DBF923EBC@thebuild.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sun, 19 May 2024, Christophe Pettus wrote: > Of course, you can probably also shorten the query to: > > UPDATE people SET active=true WHERE ... > > Where ... is the predicate you would have used in the SELECT id WHERE ... Ah, yes. Hadn't thought of that. The statement would be UPDATE people SET active=true WHERE email is not null; Thanks, Christophe, Rich