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 1lSsDO-0005ro-8a for pgsql-general@arkaria.postgresql.org; Sun, 04 Apr 2021 02:10:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lSsDN-0007V4-80 for pgsql-general@arkaria.postgresql.org; Sun, 04 Apr 2021 02:10:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lSsDN-0007Uv-1O for pgsql-general@lists.postgresql.org; Sun, 04 Apr 2021 02:10:13 +0000 Received: from mail-oi1-x236.google.com ([2607:f8b0:4864:20::236]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lSsDL-0001zF-2e for pgsql-general@lists.postgresql.org; Sun, 04 Apr 2021 02:10:12 +0000 Received: by mail-oi1-x236.google.com with SMTP id w70so8627125oie.0 for ; Sat, 03 Apr 2021 19:10:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=xYcVButioqehe/T2QcdyolKriJG4gIK0wlBOOIE8gwA=; b=fhsUg3bx5apf9n7IypXGY7Qj7Z7hqrJD/7f177RUpZ4IL5xdyWwxR6R1n2SJlW325k gftL3iE286zZXT3hpeTyE9OlsbqkxoKKUEdAPt2FmE+mZBj5jD7VIKIj6RtCsFhm62id F4xhBpW2SpVcLsPAzX8cF6ieBnit5zfhfTARPGZ/U448Ggo3N7uTsKCfBv5YjeivlkTK Q/OkKc4ZytFGWF6NvvDCw0MN4kW9yW6EitYt6oD3xcFNmbdYJqn7m4icBeYXOt5PlBDy xZQn7F9tRCV8/C1RPpGN8GZ+YxNhJL+juD67Nb+2D4ehmWDmSyqUQ6s70PFe75BeTWb/ XcTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=xYcVButioqehe/T2QcdyolKriJG4gIK0wlBOOIE8gwA=; b=CLEUlli71t6pwXgTpqIxKwRSUnl21wJlp49z8fb6UBqrZZatCfRxz0CvWz1pjs+sZo BKGR1rxSFv56phuYPYND500V1RiXTyvOLCiYXBPC0MAyP/lSX8oZag1TOcrTiT5+auin tUuZJuyLaC/3so280Kcx88RnaHCXW/qY+xAgTIf1q/jW4C5YOgD/2aRzps2OGdcYaso6 6RAkFetTxzTjk5xhaa/Q1Gjr8+QtRBOMsGG4+BFvtkhAd6prcRJ1xfdA/NhTH8xGLD4B xsSGFpvk7AuAhA246B1NwsPjrxuIeNv18DDcWivaNb9KOm+eb+0ybcbTYhvHyM/3K6Z+ LXGg== X-Gm-Message-State: AOAM531UYrfkdkiAtZ/5gvhRvcZe1S+1z5y1WFXkKYAoVlpz2d6rjfFD +cs0HsA1s1PjxTVf248Oesuk3qFYAFw= X-Google-Smtp-Source: ABdhPJw8+qe9mFZkpa8vShqhLn6xgabfk5Y53CjJtT59aLJLQr8wTr1pqzVO5iLQd9gZNY5sVkaVBg== X-Received: by 2002:aca:b987:: with SMTP id j129mr13692958oif.67.1617502209272; Sat, 03 Apr 2021 19:10:09 -0700 (PDT) Received: from [192.168.88.10] (ip174-67-141-204.no.no.cox.net. [174.67.141.204]) by smtp.googlemail.com with ESMTPSA id u1sm3043650otj.43.2021.04.03.19.10.08 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 03 Apr 2021 19:10:08 -0700 (PDT) Subject: Re: Slick way to update multiple tables. To: pgsql-general@lists.postgresql.org References: From: Ron Message-ID: Date: Sat, 3 Apr 2021 21:10:08 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------E272C52492B34EDE9B750CFC" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------E272C52492B34EDE9B750CFC Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 4/1/21 11:16 AM, Theodore M Rolle, Jr. wrote: > I SELECT items from three tables. > > It seems that the only way to put updated fields into their proper table > is to query /each/ field, then UPDATE /each/ table. > > Am I missing something here? > Is there a way to do this automatically? > Did you join the three tables when querying? -- Angular momentum makes the world go 'round. --------------E272C52492B34EDE9B750CFC Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit On 4/1/21 11:16 AM, Theodore M Rolle, Jr. wrote:
I SELECT items from three tables.

It seems that the only way to put updated fields into their proper table is to query each field, then UPDATE each table.

Am I missing something here?
Is there a way to do this automatically?


Did you join the three tables when querying?

--
Angular momentum makes the world go 'round.
--------------E272C52492B34EDE9B750CFC--