mirror of
https://github.com/postgres/postgres.git
synced 2025-07-08 11:42:09 +03:00
Add support for logging the current role.
Stephen Frost, with some editorialization by me.
This commit is contained in:
@ -1826,6 +1826,16 @@ log_line_prefix(StringInfo buf, ErrorData *edata)
|
||||
appendStringInfoString(buf, username);
|
||||
}
|
||||
break;
|
||||
case 'U':
|
||||
if (MyProcPort)
|
||||
{
|
||||
const char *username = GetUserNameFromId(GetUserId());
|
||||
|
||||
if (username == NULL || *username == '\0')
|
||||
username = _("[unknown]");
|
||||
appendStringInfoString(buf, username);
|
||||
}
|
||||
break;
|
||||
case 'd':
|
||||
if (MyProcPort)
|
||||
{
|
||||
|
Reference in New Issue
Block a user