Add support for logging the current role.
Stephen Frost, with some editorialization by me.
This commit is contained in:
parent
b7a0b42641
commit
a8a8867912
@ -3504,7 +3504,12 @@ local0.* /var/log/postgresql
|
|||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><literal>%u</literal></entry>
|
<entry><literal>%u</literal></entry>
|
||||||
<entry>User name</entry>
|
<entry>Login user name</entry>
|
||||||
|
<entry>yes</entry>
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<entry><literal>%U</literal></entry>
|
||||||
|
<entry>Current user name</entry>
|
||||||
<entry>yes</entry>
|
<entry>yes</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
|
@ -1826,6 +1826,16 @@ log_line_prefix(StringInfo buf, ErrorData *edata)
|
|||||||
appendStringInfoString(buf, username);
|
appendStringInfoString(buf, username);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'U':
|
||||||
|
if (MyProcPort)
|
||||||
|
{
|
||||||
|
const char *username = GetUserNameFromId(GetUserId());
|
||||||
|
|
||||||
|
if (username == NULL || *username == '\0')
|
||||||
|
username = _("[unknown]");
|
||||||
|
appendStringInfoString(buf, username);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 'd':
|
case 'd':
|
||||||
if (MyProcPort)
|
if (MyProcPort)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user