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 1kJMxb-00017l-Rl for pgsql-general@arkaria.postgresql.org; Fri, 18 Sep 2020 20:26:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kJMxa-0000Iq-QD for pgsql-general@arkaria.postgresql.org; Fri, 18 Sep 2020 20:26:22 +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 1kJMxa-0000Ib-HA for pgsql-general@lists.postgresql.org; Fri, 18 Sep 2020 20:26:22 +0000 Received: from mout.gmx.net ([212.227.15.15]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kJMxY-0003JI-G3 for pgsql-general@lists.postgresql.org; Fri, 18 Sep 2020 20:26:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1600460778; bh=4fj+SSvYkbMo13GVpmcLJoeZmcB0IiDTZMu4RHLo0rY=; h=X-UI-Sender-Class:Subject:To:References:From:Date:In-Reply-To; b=DpGZD7liakXQDckYU7kE343Xi+pwExqEA6nyJdenNpVwcOicnLGw+x61000UFlpXo U08owyRjLj2qg6T19bK+ld8QcP3cMt6/Aukio0tyvjw5nbKJp8rlZ1ZRZukVSP475L aaFNarjENrkfui5oZ8FOGMuPR6sfoxYJrpJco1Gw= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.178.20] ([83.171.174.165]) by mail.gmx.com (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N3se2-1kSPNq27zE-00zkOE for ; Fri, 18 Sep 2020 22:26:18 +0200 Subject: Re: How to write such a query To: pgsql-general@lists.postgresql.org References: <912dd33c-c837-a226-111f-413fcb7321c1@aklaver.com> From: Thomas Kellerer Message-ID: Date: Fri, 18 Sep 2020 22:26:18 +0200 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.5.666 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:t6PC/nxn4kLf9CDupEHbTFkcVMO8LSUzbY7kx/jfDcmlT5mlUn9 eK82oiOk8aeRbTfllTDYjqHovk7ynHZNOKPkxNjWC1Li0DZKnrNqLJJn2eZ4gxVHDefKVp4 j42prFOkAissaHFoNhbyU/k3Sn1RxYfbdvDB3K2VGH2u54rbiMSZjTvojRlyDWMliUy9nKC Z+jtd34hyFi5hKJP3mqLQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:KA8So6whlnI=:7nWAQNd3kf9uqIq8hN1OjR la/7R/OcoZ9a1l0yMg4XiSRR62KmcgbJVeaWAbw1cujJu/YK0mCO+c2rJ2ccIhpyw+35bks+V E47OJquFxKZuanFCiTcVUtsDG2fBdJEquTcondxe/dUHoyZGfDydY8UDmyyF4Ue0z74TgaIYp 7yIfleAd01OuLPmHp/GcLMjvC+TTgbdgRXdLlZ7cYrz/gbBD9o6TKX7JMOYHXyJmb+6y38xVe 9MqNexArxTPvj4S0NUXruw50AFq1YdZGKtaHw9deEfSXwXyijcHG+BwME3/JoyRsdekKOysH9 Onu2NYlyXH1DvfqW+tc3NLkGwHlVZoPUlDctLMoQ1L4zKh6Jzb5dr7nTTKYjOLP3qU1++h/VQ IItuGSnzs13cAhxfteIHfO36zleiwFyHiq1qvJ2eKTqhiTci1Sd5xzZGmubm8CTam2ytePBE3 Rk0VcUveXGUJD/84MLByjr8G0KAiqthF4ToxtJG3ZgvFicoOaAPr/zlqREc552aTZeUbwQ30J S8E43COk+nPf3ZQtIcHu2K5BlEOBx3J9IlxQ3DQzeIBOesEpMC6yZAZUzRG/G0NjoNelN59u2 G3ZSI/9aFRaqFgNxS+9boZoUMRRuN7LKSwHB54em2TtE2h15GKfOR8JpwDHHZO9hsi6qmc3xM Cq5dYEP0UtYTdef/4p752H3/B/kZu/y1hG0fY3jkxXgiMW1zZb/5/qDGScFsvBLNjD1oQ1bCT L4hvva5tgC5UnSSDyvcrVKtDnlgjZ0vA7Uvu8jHr/pfcUKA/b8STEVdOfQHYkgqV6BZWQGaSF XjIu8gbTQMk/yqu/CGVGhl2M2FDrIXh5xx1n4WCNKErZipLQZkE9evptF7W8ieLuzvaUp/gtq r3GvTmqV9kwQGdJDk6g5dP+W8qzrDBwKLatCCX/4L0Brceq+4AJcCxlO0YOGFUI9LZKdUnylE PxikMZAGSoDMqgx2zURWTyj1wt5dP8RaCKN0iwpt9puAdN1jYTe3VvlfeBJ2ekwK6WXYiK7cD s9fJKmOOFmAjYjYGY5iL/7USK6qx0tefM5v8aDAGYYbH4WyUU2wiZMFQVJ2HJagaOggSErDyB TbsbUZCoeq+5Eh1HfSQjZydsTTIfS0AWX0B/l56EmJI1/KEhp3TDvMJgkeFQ3+7oxvzDcnXoB tkUpWvmwPG1nMcFr+rIMQYT2R9YbGj4yREapp5o4om/ckENqsV199yTLUOiICzywk3+7Bux3E sjlgzKgw7wiW9TbYN List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Igor Korot schrieb am 18.09.2020 um 22:18: > Thank you for the info. > My problem is that I want to emulate Access behavior. > > As I said - Access does it without changing the query internally (I pres= ume). > > I want to do the same with PostgreSQL. > > I'm just trying to understand how to make it work for any query > > I can have 3,4,5 tables, query them and then update the Nth record in th= e resulting recordset. > > Access does it, PowerBuilder does it. I assume that they query the database to find the primary key for the tabl= e in question. Once the primary key columns are known (and part of the result), they gene= rate the appropriate UPDATE statement with a WHERE clause based on the the values in the result= to update the row that was changed. Thomas