redacting password in SQL statement in server log

Поиск
Список
Период
Сортировка
От Zhihong Yu
Тема redacting password in SQL statement in server log
Дата
Msg-id CALNJ-vRdBH3Kp08hzgy8P28bAZcQUQXBFPD-1dRfnvE3aQB3dA@mail.gmail.com
обсуждение исходный текст
Ответы Re: redacting password in SQL statement in server log  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi,
Currently, in situation such as duplicate role creation, the server log would show something such as the following:

2022-07-22 13:48:18.251 UTC [330] STATEMENT:  CREATE ROLE test WITH LOGIN PASSWORD 'foobar';

The password itself should be redacted before logging the statement.

Here is sample output with the patch applied:

2022-07-23 23:28:20.359 UTC [16850] ERROR:  role "test" already exists
2022-07-23 23:28:20.359 UTC [16850] STATEMENT:  CREATE ROLE test WITH LOGIN PASSWORD

Please take a look at the short patch.
I know variables should be declared at the start of the func - I can do that once the approach is confirmed.

Cheers
Вложения

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

Предыдущее
От: Thomas Munro
Дата:
Сообщение: Re: Cleaning up historical portability baggage
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Cleaning up historical portability baggage