plpgsql: remove a field from a record?

From: Ray O'Donnell <ray(at)rodonnell(dot)ie>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: plpgsql: remove a field from a record?
Date: 2025-12-27 16:01:27
Message-ID: 0102019b608b1887-d8e9137f-46a7-4796-9f43-0addbab3c645-000000@eu-west-1.amazonses.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.

Thanks in advance,

Ray.

--
Ray O'Donnell // Galway // Ireland
ray(at)rodonnell(dot)ie

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2025-12-27 16:13:30 Re: plpgsql: remove a field from a record?
Previous Message Tom Lane 2025-12-27 04:03:27 Re: Some questions about CREATE INDEX CONCURRENTLY and pg_advisory_lock