Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita8a8867

Browse files
committed
Add support for logging the current role.
Stephen Frost, with some editorialization by me.
1 parentb7a0b42 commita8a8867

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

‎doc/src/sgml/config.sgml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3504,7 +3504,12 @@ local0.* /var/log/postgresql
35043504
</row>
35053505
<row>
35063506
<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>
35083513
<entry>yes</entry>
35093514
</row>
35103515
<row>

‎src/backend/utils/error/elog.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1826,6 +1826,16 @@ log_line_prefix(StringInfo buf, ErrorData *edata)
18261826
appendStringInfoString(buf,username);
18271827
}
18281828
break;
1829+
case'U':
1830+
if (MyProcPort)
1831+
{
1832+
constchar*username=GetUserNameFromId(GetUserId());
1833+
1834+
if (username==NULL||*username=='\0')
1835+
username=_("[unknown]");
1836+
appendStringInfoString(buf,username);
1837+
}
1838+
break;
18291839
case'd':
18301840
if (MyProcPort)
18311841
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp