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 1sHWAy-008X3x-6i for pgsql-general@arkaria.postgresql.org; Wed, 12 Jun 2024 22:10:40 +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 1sHWAw-008OL5-18 for pgsql-general@arkaria.postgresql.org; Wed, 12 Jun 2024 22:10:38 +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.94.2) (envelope-from ) id 1sHWAv-008OJK-MH for pgsql-general@lists.postgresql.org; Wed, 12 Jun 2024 22:10:38 +0000 Received: from mail-oi1-x22c.google.com ([2607:f8b0:4864:20::22c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sHWAu-0011W2-5O for pgsql-general@lists.postgresql.org; Wed, 12 Jun 2024 22:10:37 +0000 Received: by mail-oi1-x22c.google.com with SMTP id 5614622812f47-3c9cc681ee7so163850b6e.1 for ; Wed, 12 Jun 2024 15:10:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718230235; x=1718835035; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=apmvjxDjLzdvGFUlZXMwG1/UEkgJ2D9yF+X9nuqH34M=; b=H0ZVGZ4p3Plp7cAIbnWqInfDHxrQZRoAJyGNeZO7+f9yYtArHcIsOYyJKrr2DWOJDF TaN45un00M00pi/keHMwpYKLQablgHJqY2zmcfHhpK2HN7q4smhF8ZPffZbrWZD7PqK4 YHURjcP6rSozORk7I/R4rgUKKTxcFQonKx29n8x3ZnN1nMWhmSQXHTPqnlDs6erK6CAT 86qpmJGYyL+zTqjxEv1YOXyunUR4bISUTe7JopjwyLDBOteMKEA3v3gdsKDBONKe/ywL sPg4bI22/7grTXf+1tiZTZg1cu2RzKeFE9x+R6K4Dn8HRnmDXN2/x0evFvP7vXPDEG7l +Shg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718230235; x=1718835035; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=apmvjxDjLzdvGFUlZXMwG1/UEkgJ2D9yF+X9nuqH34M=; b=meqno/AjWvRq7B7bS9GiwpnAXCJKOrcvNF7J8YcayUq1xfQ0myR3+V3JIvK2hgsIHR JjOfu8eUw38qpcHJyCeIFAiJ5rZxkWA1xeLNPhrC77x+6NrisdmUqvEXtfw4REnx+Hpd 7RiosMztg09Uakh0fWI8ZGQcpY1d6j+3/I9Myre4ck+grgY8U/5gFtk1yttr9tMRubxO ue8lLpfVYq6j2oejK6Ig2bFWhXprri83UukVMCXU02FcRuwsORvSO5IfRX1ReRNTOYKQ xf41QOpDbciIkZtsEKK2YjRCw5Voa+LCrNrXhsgc3P1JD8/1OuiRCnvXxpg6TmUAazj9 57FQ== X-Gm-Message-State: AOJu0YxA0WrSqSgrCX4P0Pdi8lujZzvnYS0Hr/Isq84sWWuJS5Vaup4y NyFevKBk7LN9+NGGfxXaLm5ag+XE5p6xzZfGnKWUY6f703NREuLpBAvQACh2tKfiDpKovytdvE0 jG9hrAdpRcx6X+e3lWdG/YZVYGpJUWg== X-Google-Smtp-Source: AGHT+IFtErhFKF/1muKcMLqHV7uITB0C22ZuijotX7VRYqtQb9GlKHyxJl+ZT3nFjHx08Tk6pbk1mHA5M8EX5YZcK0Y= X-Received: by 2002:a05:6808:19a6:b0:3d2:1755:bc40 with SMTP id 5614622812f47-3d244df510fmr506081b6e.6.1718230233908; Wed, 12 Jun 2024 15:10:33 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: "David G. Johnston" Date: Wed, 12 Jun 2024 15:09:57 -0700 Message-ID: Subject: Re: UPDATE with multiple WHERE conditions To: Rich Shepard Cc: pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000bc0dba061ab8a690" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000bc0dba061ab8a690 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Jun 12, 2024 at 2:28=E2=80=AFPM Rich Shepard wrote: > I have a table with 3492 rows. I want to update a boolean column from > 'false' to 'true' for 295 rows based on the value of another column. > > Is there a way to access a file with those condition values? > I'll often just use a spreadsheet to build the 295 update commands and copy-paste them into psql or whatnot. David J. --000000000000bc0dba061ab8a690 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, Jun 12, 2024 at 2:28=E2=80=AFPM Rich Shepard <<= a href=3D"mailto:rshepard@appl-ecosys.com">rshepard@appl-ecosys.com>= wrote:
I have a table with 3492 rows. I want to u= pdate a boolean column from
'false' to 'true' for 295 rows based on the value of anothe= r column.

Is there a way to access a file with those condition values?

I'll often just=C2=A0use a spreadsheet to build the= 295 update commands and copy-paste them into psql or whatnot.

=
David J.
--000000000000bc0dba061ab8a690--