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

Commit8fed952

Browse files
author
Artur Zakirov
committed
Fixed error: relation public.sr_plans does not exist
1 parentbbec89c commit8fed952

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

‎contrib/sr_plan/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ endif
2323

2424
genparser:
2525
#test -d sr_plan_env ||
26-
python gen_parser.py nodes.h `pg_config --includedir-server`
26+
python gen_parser.py nodes.h `$(PG_CONFIG) --includedir-server`

‎contrib/sr_plan/sr_plan.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ PlannedStmt *sr_planner(Query *parse,
6060
boolfind_ok= false;
6161
LOCKMODEheap_lock=AccessShareLock;
6262
Oidquery_index_rel_oid;
63+
Oidsr_plans_oid;
6364
IndexScanDescquery_index_scan;
6465
ScanKeyDatakey;
6566

@@ -81,11 +82,21 @@ PlannedStmt *sr_planner(Query *parse,
8182
sr_query_walker((Query*)parse,NULL);
8283

8384
sr_plans_table_rv=makeRangeVar("public","sr_plans",-1);
84-
sr_plans_heap=heap_openrv(sr_plans_table_rv,heap_lock);
85+
/* First check existance of "sr_plans" table */
86+
sr_plans_oid=RangeVarGetRelid(sr_plans_table_rv,heap_lock, true);
87+
if (!OidIsValid(sr_plans_oid))
88+
{
89+
elog(WARNING,"Not found sr_plans table");
90+
returnstandard_planner(parse,cursorOptions,boundParams);
91+
}
92+
93+
/* Table "sr_plans" exists */
94+
sr_plans_heap=heap_open(sr_plans_oid,NoLock);
8595

8696
query_index_rel_oid=DatumGetObjectId(DirectFunctionCall1(to_regclass,PointerGetDatum(cstring_to_text("sr_plans_query_hash_idx"))));
8797
if (query_index_rel_oid==InvalidOid)
8898
{
99+
heap_close(sr_plans_heap,heap_lock);
89100
elog(WARNING,"Not found sr_plans_query_hash_idx index");
90101
returnstandard_planner(parse,cursorOptions,boundParams);
91102
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp