Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
f88a6381
Commit
f88a6381
authored
14 years ago
by
Magnus Hagander
Browse files
Options
Downloads
Patches
Plain Diff
Only show pg_stat_replication details to superusers
parent
fe12263c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/src/sgml/monitoring.sgml
+3
-1
3 additions, 1 deletion
doc/src/sgml/monitoring.sgml
src/backend/replication/walsender.c
+14
-2
14 additions, 2 deletions
src/backend/replication/walsender.c
with
17 additions
and
3 deletions
doc/src/sgml/monitoring.sgml
+
3
−
1
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>
...
...
This diff is collapsed.
Click to expand it.
src/backend/replication/walsender.c
+
14
−
2
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
);
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
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment