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 1l3Poq-0007xb-Sj for pgsql-general@arkaria.postgresql.org; Sat, 23 Jan 2021 20:47:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l3Pon-0006cM-VN for pgsql-general@arkaria.postgresql.org; Sat, 23 Jan 2021 20:47:37 +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 1l3Pon-0006cF-Nt for pgsql-general@lists.postgresql.org; Sat, 23 Jan 2021 20:47:37 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l3Pok-0006Qg-A1 for pgsql-general@lists.postgresql.org; Sat, 23 Jan 2021 20:47:37 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 6CACD116D; Sat, 23 Jan 2021 15:47:29 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sat, 23 Jan 2021 15:47:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=r T+2Qe4t9RnVwoE8XrwoeNhuC+dm2hmJqb24a19GwrU=; b=GVdPo8y2acn2Y9ci0 LwHk2ZpaYSz6Idwfz8jX27+RT+L6/Qghru1knIUJeV5rsTAl2aYYpJdiffNYt4ya sqGxuFGAElu/RPtiC94Min7F5ZAtKjgeRo+d/VTSn1Tepnry/O1waKgWDKM1PzxM JL6nmS9X9A0rBGUQSNtPvTGUqkOrEo5pwKZfPDI+NVxQoRho0+rITORLFeaMdU5G NQSk7jafEFg5RwW18Fzpu08aVrJefy0AgSOj1DKaIquOXMexe+Gzo48ibjdZDAhu AnhTTZ7AK2s7GAhY3ggzzZfq2Zmgp7Wl53TbwyynkmGk4iIQtUqw71Vje0RzDEq2 MhLdw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=rT+2Qe4t9RnVwoE8XrwoeNhuC+dm2hmJqb24a19Gw rU=; b=HXH78WdnPrsk6vUQlKmKJgy0NQplB2HEuGwUS7kBTJN2XTbB4jfsWCPHz fKgN3A73EXCY17wBWa3KPHm6GYfhJDCsMAvWWxEbkuLiAIPNkRsMhpT3Fmk9zqIy 3ylyJeWHXlFjQ2e9ZUOdgDcffvswCy78j8mGXcerV3d6SSCtZwOfwR7Os5WsEdUb vmTsC9T9bGSNUD5yktysZA7SqfNvVyVmcjJ8FHrAnYYU67y7ElnT47eYeMUzb0pI ruzSVKw/bfiFOuWeAqAHLtyApgKNoLukvZK52I+407VAa1Lh3Ua5LBwgbEr7B5yg 0ZUhSqzFSe0Ukb5nbjGzmZbT/Xu+A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudekgddugeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhffkffgfgggjtgfgsehtje ertddtfeejnecuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirghnrdhk lhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecuggftrfgrthhtvghrnhepteejvdetff ejuedvleeifeefheeutdfhgfdvhffhhfekvdduveegvdejudefgfevnecukfhppeejhedr udejvddrudegrddujeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Received: from [192.168.1.4] (75-172-14-17.tukw.qwest.net [75.172.14.17]) by mail.messagingengine.com (Postfix) with ESMTPA id 3E7D824005D; Sat, 23 Jan 2021 15:47:28 -0500 (EST) Subject: Re: Need help with trigger To: Condor Cc: pgsql-general@lists.postgresql.org References: <6feca05ea1521b0a4da87bfcfe78c39f@stz-bg.com> <62244d0f-03d7-6bed-cb7b-722ad32400ad@aklaver.com> <84864856b8ac6e5f35f68ace87c44556@stz-bg.com> <3294def5-09f6-c384-d1fe-f5faf4bcf797@aklaver.com> <533ed7d44063dca8b45626816aa51cad@stz-bg.com> From: Adrian Klaver Message-ID: <95e0e4d4-fb07-619f-fd51-036f8d9811ec@aklaver.com> Date: Sat, 23 Jan 2021 12:47:27 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <533ed7d44063dca8b45626816aa51cad@stz-bg.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 1/23/21 12:14 PM, Condor wrote: > On 23-01-2021 20:49, Adrian Klaver wrote: >> On 1/23/21 10:20 AM, Condor wrote: > > Sorry, > > I'm sorry, I don't understand something. You mean to do pure INSERT ON > CONFLICT DO or to modify the trigger ? No I meant that in the external program you use to fetch the data from the other table and reorganize the fields. Do your test there and do either the INSERT or UPDATE. -- Adrian Klaver adrian.klaver@aklaver.com