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

Commitf67cb71

Browse files
committed
Add function to access backend pid, pg_stat_get_backend_mypid.
1 parentb8efa87 commitf67cb71

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

‎src/backend/utils/adt/pgstatfuncs.c‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ extern Datum pg_stat_get_blocks_fetched(PG_FUNCTION_ARGS);
1919
externDatumpg_stat_get_blocks_hit(PG_FUNCTION_ARGS);
2020

2121
externDatumpg_stat_get_backend_idset(PG_FUNCTION_ARGS);
22+
externDatumpg_stat_get_backend_mypid(PG_FUNCTION_ARGS);
2223
externDatumpg_stat_get_backend_pid(PG_FUNCTION_ARGS);
2324
externDatumpg_stat_get_backend_dbid(PG_FUNCTION_ARGS);
2425
externDatumpg_stat_get_backend_userid(PG_FUNCTION_ARGS);
@@ -211,6 +212,13 @@ pg_stat_get_backend_idset(PG_FUNCTION_ARGS)
211212
}
212213

213214

215+
Datum
216+
pg_stat_get_backend_mypid(PG_FUNCTION_ARGS)
217+
{
218+
PG_RETURN_INT32(MyProcPid);
219+
}
220+
221+
214222
Datum
215223
pg_stat_get_backend_pid(PG_FUNCTION_ARGS)
216224
{

‎src/include/catalog/pg_proc.h‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: pg_proc.h,v 1.246 2002/07/24 19:11:13 petere Exp $
10+
* $Id: pg_proc.h,v 1.247 2002/07/31 00:40:40 momjian Exp $
1111
*
1212
* NOTES
1313
* The script catalog/genbki.sh reads this file and generates .bki
@@ -2703,6 +2703,8 @@ DATA(insert OID = 1935 ( pg_stat_get_blocks_hitPGNSP PGUID 12 f f t f s 1 20
27032703
DESCR("Statistics: Number of blocks found in cache");
27042704
DATA(insertOID=1936 (pg_stat_get_backend_idsetPGNSPPGUID12fftts023""pg_stat_get_backend_idset-_null_ ));
27052705
DESCR("Statistics: Currently active backend IDs");
2706+
DATA(insertOID=2026 (pg_stat_get_backend_mypidPGNSPPGUID12fftfs023""pg_stat_get_backend_mypid-_null_ ));
2707+
DESCR("Statistics: My backend ID");
27062708
DATA(insertOID=1937 (pg_stat_get_backend_pidPGNSPPGUID12fftfs123"23"pg_stat_get_backend_pid-_null_ ));
27072709
DESCR("Statistics: PID of backend");
27082710
DATA(insertOID=1938 (pg_stat_get_backend_dbidPGNSPPGUID12fftfs126"23"pg_stat_get_backend_dbid-_null_ ));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp