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
db5d7cca
Commit
db5d7cca
authored
Mar 20, 2003
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
It would also be handy if users could see their own pg_stat_activity
queries while the rest remain blank. Kevin Brown
parent
bd18c50b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
doc/src/sgml/monitoring.sgml
doc/src/sgml/monitoring.sgml
+7
-5
src/backend/utils/adt/pgstatfuncs.c
src/backend/utils/adt/pgstatfuncs.c
+3
-3
No files found.
doc/src/sgml/monitoring.sgml
View file @
db5d7cca
<!--
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/monitoring.sgml,v 1.1
6 2003/03/20 03:34:55
momjian Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/monitoring.sgml,v 1.1
7 2003/03/20 18:51:16
momjian Exp $
-->
-->
<chapter id="monitoring">
<chapter id="monitoring">
...
@@ -212,9 +212,10 @@ postgres: <replaceable>user</> <replaceable>database</> <replaceable>host</> <re
...
@@ -212,9 +212,10 @@ postgres: <replaceable>user</> <replaceable>database</> <replaceable>host</> <re
data on the current query are only available if the
data on the current query are only available if the
<varname>STATS_COMMAND_STRING</varname> configuration option has
<varname>STATS_COMMAND_STRING</varname> configuration option has
been enabled. Furthermore, these columns can only be accessed by
been enabled. Furthermore, these columns can only be accessed by
superusers; to other users, they always appear NULL. (Note that
superusers; or when the user examining the view is the same as the user
because of the collector's reporting delay, current query will
in the row; for others it reads as null. (Note that because of the
only be up-to-date for long-running queries.)</entry>
collector's reporting delay, current query will only be up-to-date for
long-running queries.)</entry>
</row>
</row>
<row>
<row>
...
@@ -534,7 +535,8 @@ postgres: <replaceable>user</> <replaceable>database</> <replaceable>host</> <re
...
@@ -534,7 +535,8 @@ postgres: <replaceable>user</> <replaceable>database</> <replaceable>host</> <re
<entry><type>text</type></entry>
<entry><type>text</type></entry>
<entry>
<entry>
Current query of backend process (NULL if caller is not
Current query of backend process (NULL if caller is not
superuser, or <varname>STATS_COMMAND_STRING</varname> is not enabled)
superuser, or is the same user as that of the backend being queried,
or <varname>STATS_COMMAND_STRING</varname> is not enabled)
</entry>
</entry>
</row>
</row>
...
...
src/backend/utils/adt/pgstatfuncs.c
View file @
db5d7cca
...
@@ -284,14 +284,14 @@ pg_stat_get_backend_activity(PG_FUNCTION_ARGS)
...
@@ -284,14 +284,14 @@ pg_stat_get_backend_activity(PG_FUNCTION_ARGS)
int
len
;
int
len
;
text
*
result
;
text
*
result
;
if
(
!
superuser
())
PG_RETURN_NULL
();
beid
=
PG_GETARG_INT32
(
0
);
beid
=
PG_GETARG_INT32
(
0
);
if
((
beentry
=
pgstat_fetch_stat_beentry
(
beid
))
==
NULL
)
if
((
beentry
=
pgstat_fetch_stat_beentry
(
beid
))
==
NULL
)
PG_RETURN_NULL
();
PG_RETURN_NULL
();
if
(
!
superuser
()
&&
beentry
->
userid
!=
GetUserId
())
PG_RETURN_NULL
();
len
=
strlen
(
beentry
->
activity
);
len
=
strlen
(
beentry
->
activity
);
result
=
palloc
(
VARHDRSZ
+
len
);
result
=
palloc
(
VARHDRSZ
+
len
);
VARATT_SIZEP
(
result
)
=
VARHDRSZ
+
len
;
VARATT_SIZEP
(
result
)
=
VARHDRSZ
+
len
;
...
...
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