File tree 2 files changed +16
-1
lines changed
2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -3504,7 +3504,12 @@ local0.* /var/log/postgresql
3504
3504
</row>
3505
3505
<row>
3506
3506
<entry><literal>%u</literal></entry>
3507
- <entry>User name</entry>
3507
+ <entry>Login user name</entry>
3508
+ <entry>yes</entry>
3509
+ </row>
3510
+ <row>
3511
+ <entry><literal>%U</literal></entry>
3512
+ <entry>Current user name</entry>
3508
3513
<entry>yes</entry>
3509
3514
</row>
3510
3515
<row>
Original file line number Diff line number Diff line change @@ -1826,6 +1826,16 @@ log_line_prefix(StringInfo buf, ErrorData *edata)
1826
1826
appendStringInfoString (buf , username );
1827
1827
}
1828
1828
break ;
1829
+ case 'U' :
1830
+ if (MyProcPort )
1831
+ {
1832
+ const char * username = GetUserNameFromId (GetUserId ());
1833
+
1834
+ if (username == NULL || * username == '\0' )
1835
+ username = _ ("[unknown]" );
1836
+ appendStringInfoString (buf , username );
1837
+ }
1838
+ break ;
1829
1839
case 'd' :
1830
1840
if (MyProcPort )
1831
1841
{
You can’t perform that action at this time.
0 commit comments