Re: plpgsql: remove a field from a record?

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: plpgsql: remove a field from a record?
Дата
Msg-id b571007a-fb84-4c6c-a86a-307d47798b7e@aklaver.com
обсуждение исходный текст
Ответ на plpgsql: remove a field from a record?  (Ray O'Donnell <ray@rodonnell.ie>)
Ответы Re: plpgsql: remove a field from a record?
Список pgsql-general
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



В списке pgsql-general по дате отправления: