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.96) (envelope-from ) id 1vZWvC-00DptN-2a for pgsql-general@arkaria.postgresql.org; Sat, 27 Dec 2025 16:13:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vZWvB-00BuBe-1u for pgsql-general@arkaria.postgresql.org; Sat, 27 Dec 2025 16:13:38 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vZWvA-00BuBV-1m for pgsql-general@lists.postgresql.org; Sat, 27 Dec 2025 16:13:38 +0000 Received: from fhigh-a2-smtp.messagingengine.com ([103.168.172.153]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vZWv8-0036e3-0g for pgsql-general@postgresql.org; Sat, 27 Dec 2025 16:13:37 +0000 Received: from phl-compute-09.internal (phl-compute-09.internal [10.202.2.49]) by mailfhigh.phl.internal (Postfix) with ESMTP id 611ED1400073; Sat, 27 Dec 2025 11:13:31 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-09.internal (MEProxy); Sat, 27 Dec 2025 11:13:31 -0500 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:subject:subject:to:to; s=fm3; t=1766852011; x=1766938411; bh=Ng6VVzBooC8dGYUOC+8QdwSZN8Qf64CyIHRwV1gfC9Y=; b= 2oGd4dPLZE3NRx96IbcyLRQ12i3LP8H86RTxrC2OS4rYsasNEJ3DOTyA9MID1MZK YQPqK/mpL4Um0obPKBXxAcqJkIT/KTbya+0LOtH5haigiOAjqig5dLJZJiwNE1FB r8SL3PTFrk3LCm1mcSepcyiadfjEC3g2w5dCI6W3HQ0HILznCHW6O81F0qS/Y4I/ RD0aIrD1MvagjGUqz/tyJwfwEKGY1cODCMb82QZVIBFSisbJbgMhdaqeJ0uPcJIY e7EFaCpZ/UCy0HCzmAtlmCeAaCx1TkBMXu3p3coVxVIGawHvxcRMt9idbkikKkWJ FjwL9S8dLugg3d6rXIA77g== 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:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1766852011; x=1766938411; bh=N g6VVzBooC8dGYUOC+8QdwSZN8Qf64CyIHRwV1gfC9Y=; b=SaYDKhZEJQ6AiWPz0 UYtw+3Gbq9AYrj8SHi4Se4J5qJD/absCJ4j/x7jrQ+XLfHFcXP2TBowde8zv8ISJ ShSQsEGZ9PDLuoepcVgrqbAqmw0uYSQmQEGoHglzJsBjijT1mmDM5WDRAjdRmxEI TWBmqNYi9oV11ryQ/qJZ3THvSsNCJLAlevlPEwcxcdB/DK2GI19iD49we6fFuNel 8sOPzF8k4eDka8sZd8yrju37J2FiwpMahvP+5F9A3M4KQlVOp7VR2KZ73TvxTPBN GZq7YsoZpD0bGgY4LTRVcdCpS+eiS20Fss0sDLjahCQ4Lwq6WpA9AOwKPPXIEZcO gb6+w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdejudekvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffvfhfhjggtgfesthejredttd dvjeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghv vghrsegrkhhlrghvvghrrdgtohhmqeenucggtffrrghtthgvrhhnpeeivdfhieehheegue eileejieettdejhedugeefleekvdelkeehtdfgiefffeekudenucevlhhushhtvghrufhi iigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrse grkhhlrghvvghrrdgtohhmpdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpohhu thdprhgtphhtthhopehrrgihsehrohguohhnnhgvlhhlrdhivgdprhgtphhtthhopehpgh hsqhhlqdhgvghnvghrrghlsehpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 27 Dec 2025 11:13:30 -0500 (EST) Message-ID: Date: Sat, 27 Dec 2025 08:13:30 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: plpgsql: remove a field from a record? To: Ray O'Donnell , pgsql-general References: <0102019b608b1887-d8e9137f-46a7-4796-9f43-0addbab3c645-000000@eu-west-1.amazonses.com> Content-Language: en-US From: Adrian Klaver In-Reply-To: <0102019b608b1887-d8e9137f-46a7-4796-9f43-0addbab3c645-000000@eu-west-1.amazonses.com> 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 12/27/25 08:01, Ray O'Donnell wrote: > Hi all, > > In a plpgsql function, is it possible to remove a field from a RECORD > value? > > My specific use-case is that I have a row returned from a MERGE > operation into a variable, declared as type RECORD, which will then be > logged; and I want to remove some potentially sensitive stuff from it > before it gets logged. > > I could manually redact the sensitive items (e.g. set them to null); but > it'd be tidier just to remove them altogether if I can. A record 'type' supports record_name.field_name notation. Not sure how many fields you want to log, but you could log only the non-sensitive fields explicitly e.g. record_name.fld1, record_name.fld3, record_name.fld4, etc. > > Thanks in advance, > > Ray. > -- Adrian Klaver adrian.klaver@aklaver.com