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 1q6tfN-0003If-4M for pgsql-general@arkaria.postgresql.org; Wed, 07 Jun 2023 13:57:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q6tfJ-0005zv-Hq for pgsql-general@arkaria.postgresql.org; Wed, 07 Jun 2023 13:57:33 +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 1q6tfI-0005yF-Iv for pgsql-general@lists.postgresql.org; Wed, 07 Jun 2023 13:57:33 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q6tfE-000nR7-2x for pgsql-general@lists.postgresql.org; Wed, 07 Jun 2023 13:57:31 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id E6F575C017D; Wed, 7 Jun 2023 09:57:26 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 07 Jun 2023 09:57:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1686146246; x=1686232646; bh=kgnFjzs41OvAKkD/2bIAKwxG07ULOgKwa57 yp51uOro=; b=RldBuW30I5knjNE7J1gLn1WqIbDy+eObh/f4wse8Z9jZUNr7uO1 d9TJG29u6P7gTRSuLRsct0V8HVOkUwFL/+ymrzUfCBcUY4xYmIo++t3gh84FzZtv eFJCdG5kjKnbZ9s/LFeeB9V6Mnguy9BQ4b+Ovk5KY+39Tcp/11Z5DtLBxbUrVqgB G8Wf8LJricVBrPdy0ef3CeWZOJvubAcnzBL7VwtxjZPxkdEDEiWqr9ds6nJ0f1xp 5UCwVAPj8Ylfwlas6I/W0VhLDIH1Y+s2FgKfN90E8pVc2u5059Uqd4jDZl+KhRYF kwPiglHazOXdiNwEVPRhJAZov1CHL5KjWNA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1686146246; x= 1686232646; bh=kgnFjzs41OvAKkD/2bIAKwxG07ULOgKwa57yp51uOro=; b=e +/W5wUrMOEHPEQkhud8L7rOPWGboQC5HoFsfWpH69UeHWRKLmB4UdlYlBsfkzyE7 fseKivBdl0QCOarNbNvXftM/1ScoD62Yc9D6bGCQkWjplAagz4mP04+LY6VhynU6 2jSGMr0lUWmPR28y+CScYknAT5UT28cI6mMBJa7UFBRVeHhDXv/vT/5dYJtjql/p BvrXbdJbgaWw+OThSKNPidmHZHlHpZUuOpfIcx4QnvORK+e6zswxBC+EIn9x3CJZ QdlBj8giJzAo7hUAEldFwclk6PNjhdnWBiNimlFwsH57Q4LJyJo34dh5icpPDosU dVFAjgBXYfDZ2616oljKA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgedtgedgjedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvfhfhjggtgfesthejredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpeffudehtddugefgkeevudffheevvefhfeettdfhveei vdfgieeghfeiueeggffggeenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhi rghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 7 Jun 2023 09:57:26 -0400 (EDT) Message-ID: Date: Wed, 7 Jun 2023 06:57:25 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Subject: Re: How to manipulate field in New record To: Lorusso Domenico , pgsql-general@lists.postgresql.org References: Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 6/7/23 05:12, Lorusso Domenico wrote: > Hello, > Looking for a global solution I've write e trigger function that as > optional parameter (argv[0]) receive the name of a specific parameter. > > My need is to get the filed from NEW and OLD record manipulate and set > back the field with new value. A new row won't have the OLD RECORD. Read: https://www.postgresql.org/docs/current/plpgsql-trigger.html and look at the examples. > > Problem 1: how to get and set this field > Problem 2: the field has Composit type -- Adrian Klaver adrian.klaver@aklaver.com