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
6615e774
Commit
6615e774
authored
Feb 24, 2014
by
Robert Haas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use pg_lsn data type in pg_stat_replication, too.
Michael Paquier, per a suggestion from Andres Freund
parent
bb818b53
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
20 deletions
+11
-20
doc/src/sgml/monitoring.sgml
doc/src/sgml/monitoring.sgml
+4
-4
src/backend/replication/walsender.c
src/backend/replication/walsender.c
+5
-14
src/include/catalog/catversion.h
src/include/catalog/catversion.h
+1
-1
src/include/catalog/pg_proc.h
src/include/catalog/pg_proc.h
+1
-1
No files found.
doc/src/sgml/monitoring.sgml
View file @
6615e774
...
...
@@ -1490,24 +1490,24 @@ postgres: <replaceable>user</> <replaceable>database</> <replaceable>host</> <re
</row>
<row>
<entry><structfield>sent_location</></entry>
<entry><type>
text
</></entry>
<entry><type>
pg_lsn
</></entry>
<entry>Last transaction log position sent on this connection</entry>
</row>
<row>
<entry><structfield>write_location</></entry>
<entry><type>
text
</></entry>
<entry><type>
pg_lsn
</></entry>
<entry>Last transaction log position written to disk by this standby
server</entry>
</row>
<row>
<entry><structfield>flush_location</></entry>
<entry><type>
text
</></entry>
<entry><type>
pg_lsn
</></entry>
<entry>Last transaction log position flushed to disk by this standby
server</entry>
</row>
<row>
<entry><structfield>replay_location</></entry>
<entry><type>
text
</></entry>
<entry><type>
pg_lsn
</></entry>
<entry>Last transaction log position replayed into the database on this
standby server</entry>
</row>
...
...
src/backend/replication/walsender.c
View file @
6615e774
...
...
@@ -67,6 +67,7 @@
#include "utils/builtins.h"
#include "utils/guc.h"
#include "utils/memutils.h"
#include "utils/pg_lsn.h"
#include "utils/ps_status.h"
#include "utils/resowner.h"
#include "utils/timeout.h"
...
...
@@ -2137,7 +2138,6 @@ pg_stat_get_wal_senders(PG_FUNCTION_ARGS)
{
/* use volatile pointer to prevent code rearrangement */
volatile
WalSnd
*
walsnd
=
&
WalSndCtl
->
walsnds
[
i
];
char
location
[
MAXFNAMELEN
];
XLogRecPtr
sentPtr
;
XLogRecPtr
write
;
XLogRecPtr
flush
;
...
...
@@ -2171,28 +2171,19 @@ pg_stat_get_wal_senders(PG_FUNCTION_ARGS)
else
{
values
[
1
]
=
CStringGetTextDatum
(
WalSndGetStateString
(
state
));
snprintf
(
location
,
sizeof
(
location
),
"%X/%X"
,
(
uint32
)
(
sentPtr
>>
32
),
(
uint32
)
sentPtr
);
values
[
2
]
=
CStringGetTextDatum
(
location
);
values
[
2
]
=
LSNGetDatum
(
sentPtr
);
if
(
write
==
0
)
nulls
[
3
]
=
true
;
snprintf
(
location
,
sizeof
(
location
),
"%X/%X"
,
(
uint32
)
(
write
>>
32
),
(
uint32
)
write
);
values
[
3
]
=
CStringGetTextDatum
(
location
);
values
[
3
]
=
LSNGetDatum
(
write
);
if
(
flush
==
0
)
nulls
[
4
]
=
true
;
snprintf
(
location
,
sizeof
(
location
),
"%X/%X"
,
(
uint32
)
(
flush
>>
32
),
(
uint32
)
flush
);
values
[
4
]
=
CStringGetTextDatum
(
location
);
values
[
4
]
=
LSNGetDatum
(
flush
);
if
(
apply
==
0
)
nulls
[
5
]
=
true
;
snprintf
(
location
,
sizeof
(
location
),
"%X/%X"
,
(
uint32
)
(
apply
>>
32
),
(
uint32
)
apply
);
values
[
5
]
=
CStringGetTextDatum
(
location
);
values
[
5
]
=
LSNGetDatum
(
apply
);
values
[
6
]
=
Int32GetDatum
(
sync_priority
[
i
]);
...
...
src/include/catalog/catversion.h
View file @
6615e774
...
...
@@ -53,6 +53,6 @@
*/
/* yyyymmddN */
#define CATALOG_VERSION_NO 201402
192
#define CATALOG_VERSION_NO 201402
241
#endif
src/include/catalog/pg_proc.h
View file @
6615e774
...
...
@@ -2634,7 +2634,7 @@ DATA(insert OID = 1936 ( pg_stat_get_backend_idset PGNSP PGUID 12 1 100 0 0 f
DESCR
(
"statistics: currently active backend IDs"
);
DATA
(
insert
OID
=
2022
(
pg_stat_get_activity
PGNSP
PGUID
12
1
100
0
0
f
f
f
f
f
t
s
1
0
2249
"23"
"{23,26,23,26,25,25,25,16,1184,1184,1184,1184,869,25,23}"
"{i,o,o,o,o,o,o,o,o,o,o,o,o,o,o}"
"{pid,datid,pid,usesysid,application_name,state,query,waiting,xact_start,query_start,backend_start,state_change,client_addr,client_hostname,client_port}"
_null_
pg_stat_get_activity
_null_
_null_
_null_
));
DESCR
(
"statistics: information about currently active backends"
);
DATA
(
insert
OID
=
3099
(
pg_stat_get_wal_senders
PGNSP
PGUID
12
1
10
0
0
f
f
f
f
f
t
s
0
0
2249
""
"{23,25,
25,25,25,25
,23,25}"
"{o,o,o,o,o,o,o,o}"
"{pid,state,sent_location,write_location,flush_location,replay_location,sync_priority,sync_state}"
_null_
pg_stat_get_wal_senders
_null_
_null_
_null_
));
DATA
(
insert
OID
=
3099
(
pg_stat_get_wal_senders
PGNSP
PGUID
12
1
10
0
0
f
f
f
f
f
t
s
0
0
2249
""
"{23,25,
3220,3220,3220,3220
,23,25}"
"{o,o,o,o,o,o,o,o}"
"{pid,state,sent_location,write_location,flush_location,replay_location,sync_priority,sync_state}"
_null_
pg_stat_get_wal_senders
_null_
_null_
_null_
));
DESCR
(
"statistics: information about currently active replication"
);
DATA
(
insert
OID
=
2026
(
pg_backend_pid
PGNSP
PGUID
12
1
0
0
0
f
f
f
f
t
f
s
0
0
23
""
_null_
_null_
_null_
_null_
pg_backend_pid
_null_
_null_
_null_
));
DESCR
(
"statistics: current backend PID"
);
...
...
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