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

Commitca1a4ab

Browse files
Ekaterina Sokolovasokolcati
Ekaterina Sokolova
authored andcommitted
Update pg_query_state to PostgreSQL 18
1. Change backend status to text conversion due to possible status set changes2. Update Travis CI
1 parentc20d892 commitca1a4ab

File tree

4 files changed

+37
-14
lines changed

4 files changed

+37
-14
lines changed

‎.travis.yml‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,21 @@ notifications:
2222
on_failure:always
2323

2424
env:
25+
-PG_VERSION=18
2526
-PG_VERSION=17
2627
-PG_VERSION=16 LEVEL=hardcore USE_TPCDS=0
2728
-PG_VERSION=16
2829
-PG_VERSION=15 LEVEL=hardcore USE_TPCDS=0
2930
-PG_VERSION=15
3031
-PG_VERSION=14 LEVEL=hardcore USE_TPCDS=0
3132
-PG_VERSION=14
32-
-PG_VERSION=13 LEVEL=hardcore USE_TPCDS=0
3333
-PG_VERSION=13
34-
-PG_VERSION=12 LEVEL=hardcore USE_TPCDS=0
3534
-PG_VERSION=12
3635
-PG_VERSION=10
3736
-PG_VERSION=9.6
3837

3938
matrix:
4039
allow_failures:
41-
-env:PG_VERSION=13 LEVEL=hardcore USE_TPCDS=1
40+
-env:PG_VERSION=12
4241
-env:PG_VERSION=10
4342
-env:PG_VERSION=9.6

‎Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ PGFILEDESC = "pg_query_state - facility to track progress of plan execution"
1313
EXTRA_CLEAN = ./isolation_output$(EXTENSION)--$(EXTVERSION).sql\
1414
Dockerfile ./tests/*.pyc ./tmp_stress
1515

16+
ISOLATION = corner_cases
1617
ISOLATION_OPTS = --load-extension=pg_query_state
1718

1819
TAP_TESTS = 1

‎pg_query_state.c‎

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,7 @@ List*QueryDescStack = NIL;
6767
staticProcSignalReasonUserIdPollReason=INVALID_PROCSIGNAL;
6868
staticProcSignalReasonQueryStatePollReason=INVALID_PROCSIGNAL;
6969
staticProcSignalReasonWorkerPollReason=INVALID_PROCSIGNAL;
70-
staticboolmodule_initialized= false;
71-
staticconstchar*be_state_str[]= {/* BackendState -> string repr */
72-
"undefined",/* STATE_UNDEFINED */
73-
"idle",/* STATE_IDLE */
74-
"active",/* STATE_RUNNING */
75-
"idle in transaction",/* STATE_IDLEINTRANSACTION */
76-
"fastpath function call",/* STATE_FASTPATH */
77-
"idle in transaction (aborted)",/* STATE_IDLEINTRANSACTION_ABORTED */
78-
"disabled",/* STATE_DISABLED */
79-
};
70+
staticboolmodule_initialized= false;
8071
staticintreqid=0;
8172

8273
typedefstruct
@@ -352,6 +343,37 @@ qs_ExecutorFinish(QueryDesc *queryDesc)
352343
PG_END_TRY();
353344
}
354345

346+
/*
347+
*Convert BackendState to string description
348+
*/
349+
staticconstchar*
350+
be_state_str(BackendStatebe_state)
351+
{
352+
switch (be_state)
353+
{
354+
caseSTATE_UNDEFINED:
355+
return"undefined";
356+
#ifPG_VERSION_NUM >=180000
357+
caseSTATE_STARTING:
358+
return"starting";
359+
#endif
360+
caseSTATE_IDLE:
361+
return"idle";
362+
caseSTATE_RUNNING:
363+
return"active";
364+
caseSTATE_IDLEINTRANSACTION:
365+
return"idle in transaction";
366+
caseSTATE_FASTPATH:
367+
return"fastpath function call";
368+
caseSTATE_IDLEINTRANSACTION_ABORTED:
369+
return"idle in transaction (aborted)";
370+
caseSTATE_DISABLED:
371+
return"disabled";
372+
default:
373+
return"unknown";
374+
}
375+
}
376+
355377
/*
356378
* Find PgBackendStatus entry
357379
*/
@@ -598,7 +620,7 @@ pg_query_state(PG_FUNCTION_ARGS)
598620

599621
if (be_status)
600622
elog(INFO,"state of backend is %s",
601-
be_state_str[be_status->st_state-STATE_UNDEFINED]);
623+
be_state_str(be_status->st_state));
602624
else
603625
elog(INFO,"backend is not running query");
604626

‎signal_handler.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
#include"commands/explain.h"
1414
#ifPG_VERSION_NUM >=180000
15+
#include"commands/explain_state.h"
1516
#include"commands/explain_format.h"
1617
#endif
1718
#include"miscadmin.h"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp