Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
f88a6381
Commit
f88a6381
authored
Jan 23, 2011
by
Magnus Hagander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only show pg_stat_replication details to superusers
parent
fe12263c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
3 deletions
+17
-3
doc/src/sgml/monitoring.sgml
doc/src/sgml/monitoring.sgml
+3
-1
src/backend/replication/walsender.c
src/backend/replication/walsender.c
+14
-2
No files found.
doc/src/sgml/monitoring.sgml
View file @
f88a6381
...
...
@@ -299,7 +299,9 @@ postgres: <replaceable>user</> <replaceable>database</> <replaceable>host</> <re
<entry>One row per WAL sender process, showing process <acronym>ID</>,
user OID, user name, application name, client's address and port number,
time at which the server process began execution, current WAL sender
state and transaction log location.
state and transaction log location. The columns detailing what exactly
the connection is doing are only visible if the user examining the view
is a superuser.
</entry>
</row>
...
...
src/backend/replication/walsender.c
View file @
f88a6381
...
...
@@ -1141,8 +1141,20 @@ pg_stat_get_wal_senders(PG_FUNCTION_ARGS)
memset
(
nulls
,
0
,
sizeof
(
nulls
));
values
[
0
]
=
Int32GetDatum
(
walsnd
->
pid
);
values
[
1
]
=
CStringGetTextDatum
(
WalSndGetStateString
(
state
));
values
[
2
]
=
CStringGetTextDatum
(
sent_location
);
if
(
!
superuser
())
{
/*
* Only superusers can see details. Other users only get
* the pid value to know it's a walsender, but no details.
*/
nulls
[
1
]
=
true
;
nulls
[
2
]
=
true
;
}
else
{
values
[
1
]
=
CStringGetTextDatum
(
WalSndGetStateString
(
state
));
values
[
2
]
=
CStringGetTextDatum
(
sent_location
);
}
tuplestore_putvalues
(
tupstore
,
tupdesc
,
values
,
nulls
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment