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

Commitbca96dd

Browse files
committed
Fix crash of pg_stat_statements_info() without library loaded
Other code paths are already protected against this case, and _PG_init()warns about that in pg_stat_statements.c. While on it, I have checkedthe other extensions of the tree but did not notice any holes.Oversight in9fbc3f3.Author: Jaime CasanovaReviewed-by: Julien RouhaudDiscussion:https://postgr.es/m/CAJKUy5gF4=_=qhJ1VX_tSGFfjKHb9BvzhRYWSApJD=Bfwp2SBw@mail.gmail.com
1 parentf854c69 commitbca96dd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

‎contrib/pg_stat_statements/pg_stat_statements.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1898,6 +1898,11 @@ pg_stat_statements_info(PG_FUNCTION_ARGS)
18981898
Datumvalues[PG_STAT_STATEMENTS_INFO_COLS];
18991899
boolnulls[PG_STAT_STATEMENTS_INFO_COLS];
19001900

1901+
if (!pgss|| !pgss_hash)
1902+
ereport(ERROR,
1903+
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
1904+
errmsg("pg_stat_statements must be loaded via shared_preload_libraries")));
1905+
19011906
/* Build a tuple descriptor for our result type */
19021907
if (get_call_result_type(fcinfo,NULL,&tupdesc)!=TYPEFUNC_COMPOSITE)
19031908
elog(ERROR,"return type must be a row type");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp