OSDN Git Service

Enhance debug output.
authorKyotaro Horiguchi <horiguchi.kyotaro@lab.ntt.co.jp>
Fri, 5 Dec 2014 07:55:44 +0000 (16:55 +0900)
committerKyotaro Horiguchi <horiguchi.kyotaro@lab.ntt.co.jp>
Thu, 18 Dec 2014 07:37:12 +0000 (16:37 +0900)
Added new debug output levels detailed and verbose. These let you see
more verbose information about what pg_hint_plan does internally.

expected/pg_hint_plan.out
expected/ut-A.out
expected/ut-G.out
expected/ut-J.out
expected/ut-L.out
expected/ut-R.out
expected/ut-S.out
pg_hint_plan.c

index 083c680..8eb4aba 100644 (file)
@@ -42,7 +42,7 @@ EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.val = t2.val;
 
 /*+ Test (t1 t2) */
 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
-INFO:  hint syntax error at or near "Test (t1 t2) "
+INFO:  pg_hint_plan: hint syntax error at or near "Test (t1 t2) "
 DETAIL:  Unrecognized hint keyword "Test".
               QUERY PLAN              
 --------------------------------------
@@ -86,7 +86,7 @@ EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
 
 /*+Set(enable_indexscan off) /* nest comment */ */
 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
-INFO:  hint syntax error at or near "/* nest comment */ */
+INFO:  pg_hint_plan: hint syntax error at or near "/* nest comment */ */
 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;"
 DETAIL:  Nested block comments are not supported.
               QUERY PLAN              
@@ -258,7 +258,7 @@ error hint:
 
 /*+Set(work_mem TO "1MB")*/
 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
-INFO:  hint syntax error at or near "Set(work_mem TO "1MB")"
+INFO:  pg_hint_plan: hint syntax error at or near "Set(work_mem TO "1MB")"
 DETAIL:  Set hint requires name and value of GUC parameter.
 LOG:  pg_hint_plan:
 used hint:
@@ -277,7 +277,7 @@ Set(work_mem TO 1MB)
 
 /*+SeqScan(t1 t2)*/
 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id;
-INFO:  hint syntax error at or near ""
+INFO:  pg_hint_plan: hint syntax error at or near ""
 DETAIL:  SeqScan hint accepts only one relation.
 LOG:  pg_hint_plan:
 used hint:
@@ -656,7 +656,7 @@ error hint:
 
 /*+Leading( */
 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id;
-INFO:  hint syntax error at or near ""
+INFO:  pg_hint_plan: hint syntax error at or near ""
 DETAIL:  Closing parenthesis is necessary.
                     QUERY PLAN                    
 --------------------------------------------------
@@ -676,7 +676,7 @@ DETAIL:  Closing parenthesis is necessary.
 
 /*+Leading( )*/
 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id;
-INFO:  hint syntax error at or near "Leading( )"
+INFO:  pg_hint_plan: hint syntax error at or near "Leading( )"
 DETAIL:  Leading hint requires at least two relations.
 LOG:  pg_hint_plan:
 used hint:
@@ -703,7 +703,7 @@ Leading()
 
 /*+Leading( t3 )*/
 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id;
-INFO:  hint syntax error at or near "Leading( t3 )"
+INFO:  pg_hint_plan: hint syntax error at or near "Leading( t3 )"
 DETAIL:  Leading hint requires at least two relations.
 LOG:  pg_hint_plan:
 used hint:
@@ -805,7 +805,7 @@ error hint:
 
 /*+Leading(t3 t4 t1 t2 t1)*/
 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id;
-INFO:  hint syntax error at or near "Leading(t3 t4 t1 t2 t1)"
+INFO:  pg_hint_plan: hint syntax error at or near "Leading(t3 t4 t1 t2 t1)"
 DETAIL:  Relation name "t1" is duplicated.
 LOG:  pg_hint_plan:
 used hint:
@@ -832,7 +832,7 @@ Leading(t3 t4 t1 t2 t1)
 
 /*+Leading(t3 t4 t4)*/
 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3, t4 WHERE t1.id = t2.id AND t1.id = t3.id AND t1.id = t4.id;
-INFO:  hint syntax error at or near "Leading(t3 t4 t4)"
+INFO:  pg_hint_plan: hint syntax error at or near "Leading(t3 t4 t4)"
 DETAIL:  Relation name "t4" is duplicated.
 LOG:  pg_hint_plan:
 used hint:
@@ -4326,25 +4326,25 @@ error hint:
 -- duplicate hint test
 /*+SeqScan(t1)SeqScan(t2)IndexScan(t1)IndexScan(t2)BitmapScan(t1)BitmapScan(t2)TidScan(t1)TidScan(t2)HashJoin(t1 t2)NestLoop(t2 t1)MergeJoin(t1 t2)Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)*/
 EXPLAIN (COSTS false) SELECT * FROM t1, t2 WHERE t1.id = t2.id AND t1.ctid = '(1,1)' AND t2.ctid = '(1,1)';
-INFO:  hint syntax error at or near "SeqScan(t1)SeqScan(t2)IndexScan(t1)IndexScan(t2)BitmapScan(t1)BitmapScan(t2)TidScan(t1)TidScan(t2)HashJoin(t1 t2)NestLoop(t2 t1)MergeJoin(t1 t2)Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)"
+INFO:  pg_hint_plan: hint syntax error at or near "SeqScan(t1)SeqScan(t2)IndexScan(t1)IndexScan(t2)BitmapScan(t1)BitmapScan(t2)TidScan(t1)TidScan(t2)HashJoin(t1 t2)NestLoop(t2 t1)MergeJoin(t1 t2)Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)"
 DETAIL:  Conflict scan method hint.
-INFO:  hint syntax error at or near "IndexScan(t1)IndexScan(t2)BitmapScan(t1)BitmapScan(t2)TidScan(t1)TidScan(t2)HashJoin(t1 t2)NestLoop(t2 t1)MergeJoin(t1 t2)Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)"
+INFO:  pg_hint_plan: hint syntax error at or near "IndexScan(t1)IndexScan(t2)BitmapScan(t1)BitmapScan(t2)TidScan(t1)TidScan(t2)HashJoin(t1 t2)NestLoop(t2 t1)MergeJoin(t1 t2)Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)"
 DETAIL:  Conflict scan method hint.
-INFO:  hint syntax error at or near "BitmapScan(t1)BitmapScan(t2)TidScan(t1)TidScan(t2)HashJoin(t1 t2)NestLoop(t2 t1)MergeJoin(t1 t2)Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)"
+INFO:  pg_hint_plan: hint syntax error at or near "BitmapScan(t1)BitmapScan(t2)TidScan(t1)TidScan(t2)HashJoin(t1 t2)NestLoop(t2 t1)MergeJoin(t1 t2)Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)"
 DETAIL:  Conflict scan method hint.
-INFO:  hint syntax error at or near "SeqScan(t2)IndexScan(t1)IndexScan(t2)BitmapScan(t1)BitmapScan(t2)TidScan(t1)TidScan(t2)HashJoin(t1 t2)NestLoop(t2 t1)MergeJoin(t1 t2)Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)"
+INFO:  pg_hint_plan: hint syntax error at or near "SeqScan(t2)IndexScan(t1)IndexScan(t2)BitmapScan(t1)BitmapScan(t2)TidScan(t1)TidScan(t2)HashJoin(t1 t2)NestLoop(t2 t1)MergeJoin(t1 t2)Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)"
 DETAIL:  Conflict scan method hint.
-INFO:  hint syntax error at or near "IndexScan(t2)BitmapScan(t1)BitmapScan(t2)TidScan(t1)TidScan(t2)HashJoin(t1 t2)NestLoop(t2 t1)MergeJoin(t1 t2)Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)"
+INFO:  pg_hint_plan: hint syntax error at or near "IndexScan(t2)BitmapScan(t1)BitmapScan(t2)TidScan(t1)TidScan(t2)HashJoin(t1 t2)NestLoop(t2 t1)MergeJoin(t1 t2)Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)"
 DETAIL:  Conflict scan method hint.
-INFO:  hint syntax error at or near "BitmapScan(t2)TidScan(t1)TidScan(t2)HashJoin(t1 t2)NestLoop(t2 t1)MergeJoin(t1 t2)Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)"
+INFO:  pg_hint_plan: hint syntax error at or near "BitmapScan(t2)TidScan(t1)TidScan(t2)HashJoin(t1 t2)NestLoop(t2 t1)MergeJoin(t1 t2)Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)"
 DETAIL:  Conflict scan method hint.
-INFO:  hint syntax error at or near "HashJoin(t1 t2)NestLoop(t2 t1)MergeJoin(t1 t2)Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)"
+INFO:  pg_hint_plan: hint syntax error at or near "HashJoin(t1 t2)NestLoop(t2 t1)MergeJoin(t1 t2)Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)"
 DETAIL:  Conflict join method hint.
-INFO:  hint syntax error at or near "NestLoop(t2 t1)MergeJoin(t1 t2)Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)"
+INFO:  pg_hint_plan: hint syntax error at or near "NestLoop(t2 t1)MergeJoin(t1 t2)Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)"
 DETAIL:  Conflict join method hint.
-INFO:  hint syntax error at or near "Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)"
+INFO:  pg_hint_plan: hint syntax error at or near "Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)"
 DETAIL:  Conflict set hint.
-INFO:  hint syntax error at or near "Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)"
+INFO:  pg_hint_plan: hint syntax error at or near "Leading(t1 t2)Leading(t2 t1)Set(enable_seqscan off)Set(enable_mergejoin on)Set(enable_seqscan on)"
 DETAIL:  Conflict leading hint.
 LOG:  pg_hint_plan:
 used hint:
@@ -5189,7 +5189,7 @@ EXPLAIN (COSTS false) SELECT * FROM t1, s0.t1, t2 WHERE public.t1.id = s0.t1.id
 
 /*+NestLoop(t1 t2)*/
 EXPLAIN (COSTS false) SELECT * FROM t1, s0.t1, t2 WHERE public.t1.id = s0.t1.id AND public.t1.id = t2.id;
-INFO:  hint syntax error at or near "NestLoop(t1 t2)"
+INFO:  pg_hint_plan: hint syntax error at or near "NestLoop(t1 t2)"
 DETAIL:  Relation name "t1" is ambiguous.
 LOG:  pg_hint_plan:
 used hint:
@@ -5211,7 +5211,7 @@ NestLoop(t1 t2)
 
 /*+Leading(t1 t2 t1)*/
 EXPLAIN (COSTS false) SELECT * FROM t1, s0.t1, t2 WHERE public.t1.id = s0.t1.id AND public.t1.id = t2.id;
-INFO:  hint syntax error at or near "Leading(t1 t2 t1)"
+INFO:  pg_hint_plan: hint syntax error at or near "Leading(t1 t2 t1)"
 DETAIL:  Relation name "t1" is ambiguous.
 LOG:  pg_hint_plan:
 used hint:
@@ -5454,7 +5454,7 @@ EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val =
 
 /*+Leading((t1))*/
 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
-INFO:  hint syntax error at or near "Leading((t1))"
+INFO:  pg_hint_plan: hint syntax error at or near "Leading((t1))"
 DETAIL:  Leading hint requires two sets of relations when parentheses nests.
 LOG:  pg_hint_plan:
 used hint:
@@ -5501,7 +5501,7 @@ error hint:
 
 /*+Leading((t1 t2 t3))*/
 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val = t3.val AND t1.id < 10;
-INFO:  hint syntax error at or near "Leading((t1 t2 t3))"
+INFO:  pg_hint_plan: hint syntax error at or near "Leading((t1 t2 t3))"
 DETAIL:  Leading hint requires two sets of relations when parentheses nests.
 LOG:  pg_hint_plan:
 used hint:
@@ -5766,7 +5766,7 @@ EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t2.val =
 
 /*+Leading(((t1 t2) t3)) Leading(((t3 t1) t2))*/
 EXPLAIN (COSTS false) SELECT * FROM t1, t2, t3 WHERE t1.id = t2.id AND t1.val = t3.val AND t1.id < ( SELECT t1_2.id FROM t1 t1_2, t2 t2_2 WHERE t1_2.id = t2_2.id AND t2_2.val > 100 ORDER BY t1_2.id LIMIT 1);
-INFO:  hint syntax error at or near "Leading(((t1 t2) t3)) Leading(((t3 t1) t2))"
+INFO:  pg_hint_plan: hint syntax error at or near "Leading(((t1 t2) t3)) Leading(((t3 t1) t2))"
 DETAIL:  Conflict leading hint.
 LOG:  pg_hint_plan:
 used hint:
@@ -8093,7 +8093,7 @@ error hint:
 
 /*+ Rows(t1 t2 #aa) */
 EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);    -- ERROR
-INFO:  hint syntax error at or near "aa"
+INFO:  pg_hint_plan: hint syntax error at or near "aa"
 DETAIL:  Rows hint requires valid number as rows estimation.
 LOG:  pg_hint_plan:
 used hint:
@@ -8112,7 +8112,7 @@ Rows(t1 t2 #aa)
 
 /*+ Rows(t1 t2 /99) */
 EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id);    -- ERROR
-INFO:  hint syntax error at or near "/99"
+INFO:  pg_hint_plan: hint syntax error at or near "/99"
 DETAIL:  Unrecognized rows value type notation.
 LOG:  pg_hint_plan:
 used hint:
index 9e7fceb..23305b5 100644 (file)
@@ -997,7 +997,7 @@ error hint:
 -- No. A-9-2-3
 /*+SeqScan(()*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "(" WHERE "(".c1 = 1;
-INFO:  hint syntax error at or near "()"
+INFO:  pg_hint_plan: hint syntax error at or near "()"
 DETAIL:  Zero-length delimited string.
             QUERY PLAN            
 ----------------------------------
@@ -1024,9 +1024,9 @@ error hint:
 -- No. A-9-2-4
 /*+SeqScan())*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1 ")" WHERE ")".c1 = 1;
-INFO:  hint syntax error at or near ")"
+INFO:  pg_hint_plan: hint syntax error at or near ")"
 DETAIL:  SeqScan hint requires a relation.
-INFO:  hint syntax error at or near ")"
+INFO:  pg_hint_plan: hint syntax error at or near ")"
 DETAIL:  Unrecognized hint keyword ")".
 LOG:  pg_hint_plan:
 used hint:
@@ -1075,7 +1075,7 @@ error hint:
 -- No. A-9-2-5
 /*+SeqScan(")*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1 """" WHERE """".c1 = 1;
-INFO:  hint syntax error at or near ""
+INFO:  pg_hint_plan: hint syntax error at or near ""
 DETAIL:  Unterminated quoted string.
             QUERY PLAN             
 -----------------------------------
@@ -1117,7 +1117,7 @@ error hint:
 -- No. A-9-2-6
 /*+SeqScan( )*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1 " " WHERE " ".c1 = 1;
-INFO:  hint syntax error at or near ""
+INFO:  pg_hint_plan: hint syntax error at or near ""
 DETAIL:  SeqScan hint requires a relation.
 LOG:  pg_hint_plan:
 used hint:
@@ -1166,7 +1166,7 @@ error hint:
 -- No. A-9-2-7
 /*+SeqScan(    )*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "    " WHERE "       ".c1 = 1;
-INFO:  hint syntax error at or near ""
+INFO:  pg_hint_plan: hint syntax error at or near ""
 DETAIL:  SeqScan hint requires a relation.
 LOG:  pg_hint_plan:
 used hint:
@@ -1218,7 +1218,7 @@ error hint:
 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "
 " WHERE "
 ".c1 = 1;
-INFO:  hint syntax error at or near ""
+INFO:  pg_hint_plan: hint syntax error at or near ""
 DETAIL:  SeqScan hint requires a relation.
 LOG:  pg_hint_plan:
 used hint:
@@ -1397,7 +1397,7 @@ error hint:
 -- No. A-9-2-11
 /*+SeqScan(/**/)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "/**/" WHERE "/**/".c1 = 1;
-INFO:  hint syntax error at or near "/**/)*/
+INFO:  pg_hint_plan: hint syntax error at or near "/**/)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "/**/" WHERE "/**/".c1 = 1;"
 DETAIL:  Nested block comments are not supported.
              QUERY PLAN              
@@ -1408,7 +1408,7 @@ DETAIL:  Nested block comments are not supported.
 
 /*+SeqScan(/**//**//**/)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "/**//**//**/" WHERE "/**//**//**/".c1 = 1;
-INFO:  hint syntax error at or near "/**//**//**/)*/
+INFO:  pg_hint_plan: hint syntax error at or near "/**//**//**/)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "/**//**//**/" WHERE "/**//**//**/".c1 = 1;"
 DETAIL:  Nested block comments are not supported.
                  QUERY PLAN                  
@@ -1424,7 +1424,7 @@ Set/**/あ")*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "tT()""      
 Set/**/あ" WHERE "tT()""      
 Set/**/あ".c1 = 1;
-INFO:  hint syntax error at or near "/**/あ")*/
+INFO:  pg_hint_plan: hint syntax error at or near "/**/あ")*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1 "tT()""      
 Set/**/あ" WHERE "tT()""      
 Set/**/あ".c1 = 1;"
@@ -1480,7 +1480,7 @@ error hint:
 -- No. A-7-4-1
 /*+Set(enable_indexscan off)Set enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-INFO:  hint syntax error at or near "enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)"
+INFO:  pg_hint_plan: hint syntax error at or near "enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)"
 DETAIL:  Opening parenthesis is necessary.
 LOG:  pg_hint_plan:
 used hint:
@@ -1500,7 +1500,7 @@ error hint:
 -- No. A-7-4-2
 /*+Set(enable_indexscan off)Set(enable_tidscan off Set(enable_bitmapscan off)SeqScan(t1)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-INFO:  hint syntax error at or near "(enable_bitmapscan off)SeqScan(t1)"
+INFO:  pg_hint_plan: hint syntax error at or near "(enable_bitmapscan off)SeqScan(t1)"
 DETAIL:  Zero-length delimited string.
 LOG:  pg_hint_plan:
 used hint:
@@ -1520,7 +1520,7 @@ error hint:
 -- No. A-7-4-3
 /*+Set(enable_indexscan off)Set(enable_tidscan "off)Set(enable_bitmapscan off)SeqScan(t1)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-INFO:  hint syntax error at or near ""
+INFO:  pg_hint_plan: hint syntax error at or near ""
 DETAIL:  Unterminated quoted string.
 LOG:  pg_hint_plan:
 used hint:
@@ -1540,7 +1540,7 @@ error hint:
 -- No. A-7-4-4
 /*+Set(enable_indexscan off)SeqScan("")Set(enable_bitmapscan off)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-INFO:  hint syntax error at or near ")Set(enable_bitmapscan off)"
+INFO:  pg_hint_plan: hint syntax error at or near ")Set(enable_bitmapscan off)"
 DETAIL:  Zero-length delimited string.
 LOG:  pg_hint_plan:
 used hint:
@@ -1560,7 +1560,7 @@ error hint:
 -- No. A-7-4-5
 /*+Set(enable_indexscan off)NoSet(enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-INFO:  hint syntax error at or near "NoSet(enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)"
+INFO:  pg_hint_plan: hint syntax error at or near "NoSet(enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)"
 DETAIL:  Unrecognized hint keyword "NoSet".
 LOG:  pg_hint_plan:
 used hint:
@@ -1580,7 +1580,7 @@ error hint:
 -- No. A-7-4-6
 /*+Set(enable_indexscan off)"Set"(enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-INFO:  hint syntax error at or near ""Set"(enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)"
+INFO:  pg_hint_plan: hint syntax error at or near ""Set"(enable_tidscan off)Set(enable_bitmapscan off)SeqScan(t1)"
 DETAIL:  Unrecognized hint keyword ""Set"".
 LOG:  pg_hint_plan:
 used hint:
@@ -1600,7 +1600,7 @@ error hint:
 -- No. A-7-4-7
 /*+Set(enable_indexscan off)Set(enable_tidscan /* value */off)Set(enable_bitmapscan off)SeqScan(t1)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
-INFO:  hint syntax error at or near "/* value */off)Set(enable_bitmapscan off)SeqScan(t1)*/
+INFO:  pg_hint_plan: hint syntax error at or near "/* value */off)Set(enable_bitmapscan off)SeqScan(t1)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;"
 DETAIL:  Nested block comments are not supported.
           QUERY PLAN          
@@ -1868,7 +1868,8 @@ EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1;
 
 -- No. A-8-3-4
 SET pg_hint_plan.debug_print TO enable;
-ERROR:  parameter "pg_hint_plan.debug_print" requires a Boolean value
+ERROR:  invalid value for parameter "pg_hint_plan.debug_print": "enable"
+HINT:  Available values: off, on, detailed, verbose.
 SHOW pg_hint_plan.debug_print;
  pg_hint_plan.debug_print 
 --------------------------
@@ -1908,7 +1909,7 @@ DEBUG:  name: unnamed; blockState:       STARTED; state: INPROGR, xid/subid/cid:
 DEBUG:  StartTransactionCommand
 DEBUG:  StartTransaction
 DEBUG:  name: unnamed; blockState:       DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
-DEBUG:  hint syntax error at or near ""
+DEBUG:  pg_hint_plan: hint syntax error at or near ""
 DETAIL:  Opening parenthesis is necessary.
 DEBUG:  CommitTransactionCommand
 DEBUG:  CommitTransaction
@@ -1964,7 +1965,7 @@ DEBUG:  name: unnamed; blockState:       STARTED; state: INPROGR, xid/subid/cid:
 DEBUG:  StartTransactionCommand
 DEBUG:  StartTransaction
 DEBUG:  name: unnamed; blockState:       DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
-DEBUG:  hint syntax error at or near ""
+DEBUG:  pg_hint_plan: hint syntax error at or near ""
 DETAIL:  Opening parenthesis is necessary.
 DEBUG:  CommitTransactionCommand
 DEBUG:  CommitTransaction
@@ -2020,7 +2021,7 @@ DEBUG:  name: unnamed; blockState:       STARTED; state: INPROGR, xid/subid/cid:
 DEBUG:  StartTransactionCommand
 DEBUG:  StartTransaction
 DEBUG:  name: unnamed; blockState:       DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 
-DEBUG:  hint syntax error at or near ""
+DEBUG:  pg_hint_plan: hint syntax error at or near ""
 DETAIL:  Opening parenthesis is necessary.
 DEBUG:  CommitTransactionCommand
 DEBUG:  CommitTransaction
@@ -2050,7 +2051,7 @@ SHOW pg_hint_plan.parse_messages;
 (1 row)
 
 /*+Set*/SELECT 1;
-DEBUG:  hint syntax error at or near ""
+DEBUG:  pg_hint_plan: hint syntax error at or near ""
 DETAIL:  Opening parenthesis is necessary.
  ?column? 
 ----------
@@ -2073,7 +2074,7 @@ SHOW pg_hint_plan.parse_messages;
 (1 row)
 
 /*+Set*/SELECT 1;
-DEBUG:  hint syntax error at or near ""
+DEBUG:  pg_hint_plan: hint syntax error at or near ""
 DETAIL:  Opening parenthesis is necessary.
  ?column? 
 ----------
@@ -2096,7 +2097,7 @@ SHOW pg_hint_plan.parse_messages;
 (1 row)
 
 /*+Set*/SELECT 1;
-LOG:  hint syntax error at or near ""
+LOG:  pg_hint_plan: hint syntax error at or near ""
 DETAIL:  Opening parenthesis is necessary.
  ?column? 
 ----------
@@ -2119,7 +2120,7 @@ SHOW pg_hint_plan.parse_messages;
 (1 row)
 
 /*+Set*/SELECT 1;
-INFO:  hint syntax error at or near ""
+INFO:  pg_hint_plan: hint syntax error at or near ""
 DETAIL:  Opening parenthesis is necessary.
  ?column? 
 ----------
@@ -2128,7 +2129,7 @@ DETAIL:  Opening parenthesis is necessary.
 
 SET client_min_messages TO notice;
 /*+Set*/SELECT 1;
-INFO:  hint syntax error at or near ""
+INFO:  pg_hint_plan: hint syntax error at or near ""
 DETAIL:  Opening parenthesis is necessary.
  ?column? 
 ----------
@@ -2144,7 +2145,7 @@ SHOW pg_hint_plan.parse_messages;
 (1 row)
 
 /*+Set*/SELECT 1;
-NOTICE:  hint syntax error at or near ""
+NOTICE:  pg_hint_plan: hint syntax error at or near ""
 DETAIL:  Opening parenthesis is necessary.
  ?column? 
 ----------
@@ -2167,7 +2168,7 @@ SHOW pg_hint_plan.parse_messages;
 (1 row)
 
 /*+Set*/SELECT 1;
-WARNING:  hint syntax error at or near ""
+WARNING:  pg_hint_plan: hint syntax error at or near ""
 DETAIL:  Opening parenthesis is necessary.
  ?column? 
 ----------
@@ -2190,7 +2191,7 @@ SHOW pg_hint_plan.parse_messages;
 (1 row)
 
 /*+Set*/SELECT 1;
-ERROR:  hint syntax error at or near ""
+ERROR:  pg_hint_plan: hint syntax error at or near ""
 DETAIL:  Opening parenthesis is necessary.
 SET client_min_messages TO fatal;
 /*+Set*/SELECT 1;
@@ -2204,7 +2205,7 @@ SHOW pg_hint_plan.parse_messages;
 (1 row)
 
 /*+Set*/SELECT 1;
-INFO:  hint syntax error at or near ""
+INFO:  pg_hint_plan: hint syntax error at or near ""
 DETAIL:  Opening parenthesis is necessary.
  ?column? 
 ----------
@@ -2309,7 +2310,7 @@ TRUNCATE hint_plan.hints;
 ----
 -- No. A-9-1-1
 /*+"Set"(enable_indexscan on)*/SELECT 1;
-INFO:  hint syntax error at or near ""Set"(enable_indexscan on)"
+INFO:  pg_hint_plan: hint syntax error at or near ""Set"(enable_indexscan on)"
 DETAIL:  Unrecognized hint keyword ""Set"".
  ?column? 
 ----------
@@ -2317,9 +2318,9 @@ DETAIL:  Unrecognized hint keyword ""Set"".
 (1 row)
 
 /*+Set()(enable_indexscan on)*/SELECT 1;
-INFO:  hint syntax error at or near "Set()(enable_indexscan on)"
+INFO:  pg_hint_plan: hint syntax error at or near "Set()(enable_indexscan on)"
 DETAIL:  Set hint requires name and value of GUC parameter.
-INFO:  hint syntax error at or near "(enable_indexscan on)"
+INFO:  pg_hint_plan: hint syntax error at or near "(enable_indexscan on)"
 DETAIL:  Unrecognized hint keyword "".
  ?column? 
 ----------
@@ -2327,7 +2328,7 @@ DETAIL:  Unrecognized hint keyword "".
 (1 row)
 
 /*+Set(enable_indexscan on*/SELECT 1;
-INFO:  hint syntax error at or near ""
+INFO:  pg_hint_plan: hint syntax error at or near ""
 DETAIL:  Closing parenthesis is necessary.
  ?column? 
 ----------
@@ -2382,7 +2383,7 @@ EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
 
 /*+TidScan(t1)BitmapScan(t1)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
-INFO:  hint syntax error at or near "TidScan(t1)BitmapScan(t1)"
+INFO:  pg_hint_plan: hint syntax error at or near "TidScan(t1)BitmapScan(t1)"
 DETAIL:  Conflict scan method hint.
 LOG:  pg_hint_plan:
 used hint:
@@ -2403,9 +2404,9 @@ error hint:
 
 /*+TidScan(t1)BitmapScan(t1)IndexScan(t1)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
-INFO:  hint syntax error at or near "TidScan(t1)BitmapScan(t1)IndexScan(t1)"
+INFO:  pg_hint_plan: hint syntax error at or near "TidScan(t1)BitmapScan(t1)IndexScan(t1)"
 DETAIL:  Conflict scan method hint.
-INFO:  hint syntax error at or near "BitmapScan(t1)IndexScan(t1)"
+INFO:  pg_hint_plan: hint syntax error at or near "BitmapScan(t1)IndexScan(t1)"
 DETAIL:  Conflict scan method hint.
 LOG:  pg_hint_plan:
 used hint:
@@ -2425,11 +2426,11 @@ error hint:
 
 /*+TidScan(t1)BitmapScan(t1)IndexScan(t1)SeqScan(t1)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1 WHERE t1.c1 = 1 AND t1.ctid = '(1,1)';
-INFO:  hint syntax error at or near "TidScan(t1)BitmapScan(t1)IndexScan(t1)SeqScan(t1)"
+INFO:  pg_hint_plan: hint syntax error at or near "TidScan(t1)BitmapScan(t1)IndexScan(t1)SeqScan(t1)"
 DETAIL:  Conflict scan method hint.
-INFO:  hint syntax error at or near "BitmapScan(t1)IndexScan(t1)SeqScan(t1)"
+INFO:  pg_hint_plan: hint syntax error at or near "BitmapScan(t1)IndexScan(t1)SeqScan(t1)"
 DETAIL:  Conflict scan method hint.
-INFO:  hint syntax error at or near "IndexScan(t1)SeqScan(t1)"
+INFO:  pg_hint_plan: hint syntax error at or near "IndexScan(t1)SeqScan(t1)"
 DETAIL:  Conflict scan method hint.
 LOG:  pg_hint_plan:
 used hint:
@@ -3376,7 +3377,7 @@ EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)NestLoop(t1 t1)*/
 PREPARE p1 AS SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
 EXPLAIN (COSTS false) EXECUTE p1;
-INFO:  hint syntax error at or near "NestLoop(t1 t1)"
+INFO:  pg_hint_plan: hint syntax error at or near "NestLoop(t1 t1)"
 DETAIL:  Relation name "t1" is duplicated.
 LOG:  pg_hint_plan:
 used hint:
@@ -3439,7 +3440,7 @@ SELECT name, setting FROM settings;
 SET pg_hint_plan.parse_messages TO error;
 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)NestLoop(t1 t1)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-ERROR:  hint syntax error at or near "NestLoop(t1 t1)"
+ERROR:  pg_hint_plan: hint syntax error at or near "NestLoop(t1 t1)"
 DETAIL:  Relation name "t1" is duplicated.
 SELECT name, setting FROM settings;
            name            |  setting  
@@ -3538,7 +3539,7 @@ SELECT name, setting FROM settings;
 SET pg_hint_plan.parse_messages TO error;
 /*+Set(enable_seqscan off)Set(geqo_threshold 100)SeqScan(t1)MergeJoin(t1 t2)NestLoop(t1 t1)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-ERROR:  hint syntax error at or near "NestLoop(t1 t1)"
+ERROR:  pg_hint_plan: hint syntax error at or near "NestLoop(t1 t1)"
 DETAIL:  Relation name "t1" is duplicated.
 SELECT name, setting FROM settings;
            name            |  setting  
@@ -4712,7 +4713,7 @@ error hint:
 EXPLAIN (COSTS false)
  SELECT recall_planner() FROM s1.t1 t_1
   ORDER BY t_1.c1;
-INFO:  hint syntax error at or near "HashJoin(t_1 t_1)"
+INFO:  pg_hint_plan: hint syntax error at or near "HashJoin(t_1 t_1)"
 DETAIL:  Relation name "t_1" is duplicated.
 CONTEXT:  SQL function "recall_planner" during startup
 LOG:  pg_hint_plan:
@@ -4768,7 +4769,7 @@ duplication hint:
 error hint:
 
 CONTEXT:  SQL function "recall_planner_one_t" during startup
-INFO:  hint syntax error at or near "HashJoin(t_1 t_1)"
+INFO:  pg_hint_plan: hint syntax error at or near "HashJoin(t_1 t_1)"
 DETAIL:  Relation name "t_1" is duplicated.
 LOG:  pg_hint_plan:
 used hint:
@@ -4795,7 +4796,7 @@ EXPLAIN (COSTS false)
  SELECT recall_planner() FROM s1.t1 t_1
    JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
   ORDER BY t_1.c1;
-INFO:  hint syntax error at or near "HashJoin(t_1 t_1)"
+INFO:  pg_hint_plan: hint syntax error at or near "HashJoin(t_1 t_1)"
 DETAIL:  Relation name "t_1" is duplicated.
 CONTEXT:  SQL function "recall_planner" during startup
 LOG:  pg_hint_plan:
@@ -4806,7 +4807,7 @@ error hint:
 HashJoin(t_1 t_1)
 
 CONTEXT:  SQL function "recall_planner" during startup
-INFO:  hint syntax error at or near "HashJoin(t_1 t_1)"
+INFO:  pg_hint_plan: hint syntax error at or near "HashJoin(t_1 t_1)"
 DETAIL:  Relation name "t_1" is duplicated.
 LOG:  pg_hint_plan:
 used hint:
@@ -4831,9 +4832,9 @@ EXPLAIN (COSTS false)
  SELECT recall_planner() FROM s1.t1 t_1
    JOIN s1.t2 t_2 ON (t_1.c1 = t_2.c1)
   ORDER BY t_1.c1;
-INFO:  hint syntax error at or near "MergeJoin(t_1 t_2)HashJoin(t_1 t_2)"
+INFO:  pg_hint_plan: hint syntax error at or near "MergeJoin(t_1 t_2)HashJoin(t_1 t_2)"
 DETAIL:  Conflict join method hint.
-INFO:  hint syntax error at or near "MergeJoin(t_1 t_2)HashJoin(t_1 t_2)"
+INFO:  pg_hint_plan: hint syntax error at or near "MergeJoin(t_1 t_2)HashJoin(t_1 t_2)"
 DETAIL:  Conflict join method hint.
 CONTEXT:  SQL function "recall_planner" during startup
 LOG:  pg_hint_plan:
index 16c0a5a..df36b84 100644 (file)
@@ -778,7 +778,7 @@ SET client_min_messages TO LOG;
 -- No. G-2-3-1
 /*+Set(enable_indexscan on)Set(enable_indexscan off)*/
 SELECT * FROM s1.t1 WHERE false;
-INFO:  hint syntax error at or near "Set(enable_indexscan on)Set(enable_indexscan off)"
+INFO:  pg_hint_plan: hint syntax error at or near "Set(enable_indexscan on)Set(enable_indexscan off)"
 DETAIL:  Conflict set hint.
 LOG:  pg_hint_plan:
 used hint:
@@ -795,9 +795,9 @@ error hint:
 -- No. G-2-3-2
 /*+Set(client_min_messages DEBUG5)Set(client_min_messages WARNING)Set(client_min_messages DEBUG2)*/
 SELECT * FROM s1.t1 WHERE false;
-INFO:  hint syntax error at or near "Set(client_min_messages DEBUG5)Set(client_min_messages WARNING)Set(client_min_messages DEBUG2)"
+INFO:  pg_hint_plan: hint syntax error at or near "Set(client_min_messages DEBUG5)Set(client_min_messages WARNING)Set(client_min_messages DEBUG2)"
 DETAIL:  Conflict set hint.
-INFO:  hint syntax error at or near "Set(client_min_messages WARNING)Set(client_min_messages DEBUG2)"
+INFO:  pg_hint_plan: hint syntax error at or near "Set(client_min_messages WARNING)Set(client_min_messages DEBUG2)"
 DETAIL:  Conflict set hint.
 LOG:  pg_hint_plan:
 used hint:
@@ -815,7 +815,7 @@ error hint:
 -- No. G-2-3-3
 /*+Set(enable_indexscan on)Set(enable_indexscan o)*/
 SELECT * FROM s1.t1 WHERE false;
-INFO:  hint syntax error at or near "Set(enable_indexscan on)Set(enable_indexscan o)"
+INFO:  pg_hint_plan: hint syntax error at or near "Set(enable_indexscan on)Set(enable_indexscan o)"
 DETAIL:  Conflict set hint.
 INFO:  parameter "enable_indexscan" requires a Boolean value
 LOG:  pg_hint_plan:
@@ -833,9 +833,9 @@ Set(enable_indexscan o)
 -- No. G-2-3-4
 /*+Set(client_min_messages DEBUG5)Set(client_min_messages WARNING)Set(client_min_messages DEBU)*/
 SELECT * FROM s1.t1 WHERE false;
-INFO:  hint syntax error at or near "Set(client_min_messages DEBUG5)Set(client_min_messages WARNING)Set(client_min_messages DEBU)"
+INFO:  pg_hint_plan: hint syntax error at or near "Set(client_min_messages DEBUG5)Set(client_min_messages WARNING)Set(client_min_messages DEBU)"
 DETAIL:  Conflict set hint.
-INFO:  hint syntax error at or near "Set(client_min_messages WARNING)Set(client_min_messages DEBU)"
+INFO:  pg_hint_plan: hint syntax error at or near "Set(client_min_messages WARNING)Set(client_min_messages DEBU)"
 DETAIL:  Conflict set hint.
 INFO:  invalid value for parameter "client_min_messages": "DEBU"
 HINT:  Available values: debug5, debug4, debug3, debug2, debug1, log, notice, warning, error.
@@ -858,9 +858,9 @@ Set(client_min_messages DEBU)
 -- No. G-2-4-1
 /*+SeqScan(a)IndexScan(a)SeqScan(c)NestLoop(a) */
 SELECT * FROM s1.t1 a, s1.t2 b WHERE false;
-INFO:  hint syntax error at or near " "
+INFO:  pg_hint_plan: hint syntax error at or near " "
 DETAIL:  NestLoop hint requires at least two relations.
-INFO:  hint syntax error at or near "SeqScan(a)IndexScan(a)SeqScan(c)NestLoop(a) "
+INFO:  pg_hint_plan: hint syntax error at or near "SeqScan(a)IndexScan(a)SeqScan(c)NestLoop(a) "
 DETAIL:  Conflict scan method hint.
 LOG:  pg_hint_plan:
 used hint:
index 0647d1f..8b2ab75 100644 (file)
@@ -195,7 +195,7 @@ EXPLAIN (COSTS false) SELECT * FROM s1.t1, s2.t1 WHERE s1.t1.c1 = s2.t1.c1;
 
 /*+HashJoin(t1 t1)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s2.t1 WHERE s1.t1.c1 = s2.t1.c1;
-INFO:  hint syntax error at or near "HashJoin(t1 t1)"
+INFO:  pg_hint_plan: hint syntax error at or near "HashJoin(t1 t1)"
 DETAIL:  Relation name "t1" is ambiguous.
 LOG:  pg_hint_plan:
 used hint:
@@ -357,7 +357,7 @@ error hint:
 -- No. J-1-5-2
 /*+HashJoin(t1 t1)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-INFO:  hint syntax error at or near "HashJoin(t1 t1)"
+INFO:  pg_hint_plan: hint syntax error at or near "HashJoin(t1 t1)"
 DETAIL:  Relation name "t1" is duplicated.
 LOG:  pg_hint_plan:
 used hint:
@@ -379,9 +379,9 @@ HashJoin(t1 t1)
 -- No. J-1-5-3
 /*+HashJoin(t1 t1)HashJoin(t2 t2)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-INFO:  hint syntax error at or near "HashJoin(t1 t1)HashJoin(t2 t2)"
+INFO:  pg_hint_plan: hint syntax error at or near "HashJoin(t1 t1)HashJoin(t2 t2)"
 DETAIL:  Relation name "t1" is duplicated.
-INFO:  hint syntax error at or near "HashJoin(t2 t2)"
+INFO:  pg_hint_plan: hint syntax error at or near "HashJoin(t2 t2)"
 DETAIL:  Relation name "t2" is duplicated.
 LOG:  pg_hint_plan:
 used hint:
@@ -417,7 +417,7 @@ EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3 WHERE t1.c1 = t2.c1 AND
 
 /*+HashJoin(t1 t2 t1 t2)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-INFO:  hint syntax error at or near "HashJoin(t1 t2 t1 t2)"
+INFO:  pg_hint_plan: hint syntax error at or near "HashJoin(t1 t2 t1 t2)"
 DETAIL:  Relation name "t1" is duplicated.
 LOG:  pg_hint_plan:
 used hint:
@@ -3650,7 +3650,7 @@ EXPLAIN (COSTS false) SELECT * FROM s1.v1 v1, s1.v1 v2 WHERE v1.c1 = v2.c1;
 
 /*+HashJoin(v1t1 v1t1)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.v1 v1, s1.v1 v2 WHERE v1.c1 = v2.c1;
-INFO:  hint syntax error at or near "HashJoin(v1t1 v1t1)"
+INFO:  pg_hint_plan: hint syntax error at or near "HashJoin(v1t1 v1t1)"
 DETAIL:  Relation name "v1t1" is ambiguous.
 LOG:  pg_hint_plan:
 used hint:
@@ -3709,7 +3709,7 @@ EXPLAIN (COSTS false) SELECT * FROM s1.r4 t1, s1.r4 t2 WHERE t1.c1 = t2.c1;
 
 /*+HashJoin(r4t1 r4t1)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.r4 t1, s1.r4 t2 WHERE t1.c1 = t2.c1;
-INFO:  hint syntax error at or near "HashJoin(r4t1 r4t1)"
+INFO:  pg_hint_plan: hint syntax error at or near "HashJoin(r4t1 r4t1)"
 DETAIL:  Relation name "r4t1" is ambiguous.
 LOG:  pg_hint_plan:
 used hint:
@@ -3864,11 +3864,11 @@ error hint:
 
 /*+ Leading(*VALUES* t3 t2 t1) NestLoop(t4 t3)HashJoin(*VALUES* t3 t2)MergeJoin(*VALUES* t3 t2 t1)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1')) AS t3 (c1, c2, c3, c4), (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t4 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-INFO:  hint syntax error at or near "HashJoin(*VALUES* t3 t2)MergeJoin(*VALUES* t3 t2 t1)"
+INFO:  pg_hint_plan: hint syntax error at or near "HashJoin(*VALUES* t3 t2)MergeJoin(*VALUES* t3 t2 t1)"
 DETAIL:  Relation name "*VALUES*" is ambiguous.
-INFO:  hint syntax error at or near "MergeJoin(*VALUES* t3 t2 t1)"
+INFO:  pg_hint_plan: hint syntax error at or near "MergeJoin(*VALUES* t3 t2 t1)"
 DETAIL:  Relation name "*VALUES*" is ambiguous.
-INFO:  hint syntax error at or near "Leading(*VALUES* t3 t2 t1) NestLoop(t4 t3)HashJoin(*VALUES* t3 t2)MergeJoin(*VALUES* t3 t2 t1)"
+INFO:  pg_hint_plan: hint syntax error at or near "Leading(*VALUES* t3 t2 t1) NestLoop(t4 t3)HashJoin(*VALUES* t3 t2)MergeJoin(*VALUES* t3 t2 t1)"
 DETAIL:  Relation name "*VALUES*" is ambiguous.
 LOG:  pg_hint_plan:
 used hint:
@@ -4394,7 +4394,7 @@ EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
 -- No. J-3-3-1
 /*+HashJoin(t1 t2)NestLoop(t1 t2)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-INFO:  hint syntax error at or near "HashJoin(t1 t2)NestLoop(t1 t2)"
+INFO:  pg_hint_plan: hint syntax error at or near "HashJoin(t1 t2)NestLoop(t1 t2)"
 DETAIL:  Conflict join method hint.
 LOG:  pg_hint_plan:
 used hint:
@@ -4415,9 +4415,9 @@ error hint:
 -- No. J-3-3-2
 /*+MergeJoin(t1 t2)HashJoin(t1 t2)NestLoop(t1 t2)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-INFO:  hint syntax error at or near "MergeJoin(t1 t2)HashJoin(t1 t2)NestLoop(t1 t2)"
+INFO:  pg_hint_plan: hint syntax error at or near "MergeJoin(t1 t2)HashJoin(t1 t2)NestLoop(t1 t2)"
 DETAIL:  Conflict join method hint.
-INFO:  hint syntax error at or near "HashJoin(t1 t2)NestLoop(t1 t2)"
+INFO:  pg_hint_plan: hint syntax error at or near "HashJoin(t1 t2)NestLoop(t1 t2)"
 DETAIL:  Conflict join method hint.
 LOG:  pg_hint_plan:
 used hint:
@@ -4439,7 +4439,7 @@ error hint:
 -- No. J-3-3-3
 /*+HashJoin(t1 t2)NestLoop(t2 t1)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-INFO:  hint syntax error at or near "HashJoin(t1 t2)NestLoop(t2 t1)"
+INFO:  pg_hint_plan: hint syntax error at or near "HashJoin(t1 t2)NestLoop(t2 t1)"
 DETAIL:  Conflict join method hint.
 LOG:  pg_hint_plan:
 used hint:
@@ -4460,9 +4460,9 @@ error hint:
 -- No. J-3-3-4
 /*+MergeJoin(t2 t1)HashJoin(t1 t2)NestLoop(t2 t1)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-INFO:  hint syntax error at or near "MergeJoin(t2 t1)HashJoin(t1 t2)NestLoop(t2 t1)"
+INFO:  pg_hint_plan: hint syntax error at or near "MergeJoin(t2 t1)HashJoin(t1 t2)NestLoop(t2 t1)"
 DETAIL:  Conflict join method hint.
-INFO:  hint syntax error at or near "HashJoin(t1 t2)NestLoop(t2 t1)"
+INFO:  pg_hint_plan: hint syntax error at or near "HashJoin(t1 t2)NestLoop(t2 t1)"
 DETAIL:  Conflict join method hint.
 LOG:  pg_hint_plan:
 used hint:
@@ -4571,7 +4571,7 @@ error hint:
 -- No. J-3-4-7
 /*+NestLoop()*/
 SELECT * FROM s1.t1 WHERE false;
-INFO:  hint syntax error at or near ""
+INFO:  pg_hint_plan: hint syntax error at or near ""
 DETAIL:  NestLoop hint requires at least two relations.
 LOG:  pg_hint_plan:
 used hint:
@@ -4587,7 +4587,7 @@ NestLoop()
 -- No. J-3-4-8
 /*+NestLoop(t1)*/
 SELECT * FROM s1.t1 WHERE false;
-INFO:  hint syntax error at or near ""
+INFO:  pg_hint_plan: hint syntax error at or near ""
 DETAIL:  NestLoop hint requires at least two relations.
 LOG:  pg_hint_plan:
 used hint:
index f928aa5..1d0fed2 100644 (file)
@@ -276,7 +276,7 @@ EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s2.t1 WHERE s1.t1.c1 =
 
 /*+Leading(t1 t2 t3 t1)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s2.t1 WHERE s1.t1.c1 = t2.c1 AND s1.t1.c1 = t3.c1 AND s1.t1.c1 = s2.t1.c1;
-INFO:  hint syntax error at or near "Leading(t1 t2 t3 t1)"
+INFO:  pg_hint_plan: hint syntax error at or near "Leading(t1 t2 t3 t1)"
 DETAIL:  Relation name "t1" is ambiguous.
 LOG:  pg_hint_plan:
 used hint:
@@ -529,7 +529,7 @@ error hint:
 -- No. L-1-5-2
 /*+Leading(t4 t2 t3 t1 t4)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-INFO:  hint syntax error at or near "Leading(t4 t2 t3 t1 t4)"
+INFO:  pg_hint_plan: hint syntax error at or near "Leading(t4 t2 t3 t1 t4)"
 DETAIL:  Relation name "t4" is duplicated.
 LOG:  pg_hint_plan:
 used hint:
@@ -557,7 +557,7 @@ Leading(t4 t2 t3 t1 t4)
 
 /*+Leading(t4 t2 t3 t4)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-INFO:  hint syntax error at or near "Leading(t4 t2 t3 t4)"
+INFO:  pg_hint_plan: hint syntax error at or near "Leading(t4 t2 t3 t4)"
 DETAIL:  Relation name "t4" is duplicated.
 LOG:  pg_hint_plan:
 used hint:
@@ -586,7 +586,7 @@ Leading(t4 t2 t3 t4)
 -- No. L-1-5-3
 /*+Leading(t4 t2 t3 t1 t4 t2 t3 t1)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-INFO:  hint syntax error at or near "Leading(t4 t2 t3 t1 t4 t2 t3 t1)"
+INFO:  pg_hint_plan: hint syntax error at or near "Leading(t4 t2 t3 t1 t4 t2 t3 t1)"
 DETAIL:  Relation name "t4" is duplicated.
 LOG:  pg_hint_plan:
 used hint:
@@ -614,7 +614,7 @@ Leading(t4 t2 t3 t1 t4 t2 t3 t1)
 
 /*+Leading(t4 t2 t2 t4)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-INFO:  hint syntax error at or near "Leading(t4 t2 t2 t4)"
+INFO:  pg_hint_plan: hint syntax error at or near "Leading(t4 t2 t2 t4)"
 DETAIL:  Relation name "t2" is duplicated.
 LOG:  pg_hint_plan:
 used hint:
@@ -3486,7 +3486,7 @@ EXPLAIN (COSTS false) SELECT * FROM s1.v1 v1, s1.v1 v2 WHERE v1.c1 = v2.c1;
 
 /*+Leading(v1t1 v1t1)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.v1 v1, s1.v1 v2 WHERE v1.c1 = v2.c1;
-INFO:  hint syntax error at or near "Leading(v1t1 v1t1)"
+INFO:  pg_hint_plan: hint syntax error at or near "Leading(v1t1 v1t1)"
 DETAIL:  Relation name "v1t1" is ambiguous.
 LOG:  pg_hint_plan:
 used hint:
@@ -3546,7 +3546,7 @@ EXPLAIN (COSTS false) SELECT * FROM s1.r4 t1, s1.r4 t2 WHERE t1.c1 = t2.c1;
 
 /*+Leading(r4t1 r4t1)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.r4 t1, s1.r4 t2 WHERE t1.c1 = t2.c1;
-INFO:  hint syntax error at or near "Leading(r4t1 r4t1)"
+INFO:  pg_hint_plan: hint syntax error at or near "Leading(r4t1 r4t1)"
 DETAIL:  Relation name "r4t1" is ambiguous.
 LOG:  pg_hint_plan:
 used hint:
@@ -3694,7 +3694,7 @@ error hint:
 
 /*+ Leading(*VALUES* t3 t2 t1) */
 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1')) AS t3 (c1, c2, c3, c4), (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t4 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-INFO:  hint syntax error at or near "Leading(*VALUES* t3 t2 t1) "
+INFO:  pg_hint_plan: hint syntax error at or near "Leading(*VALUES* t3 t2 t1) "
 DETAIL:  Relation name "*VALUES*" is ambiguous.
 LOG:  pg_hint_plan:
 used hint:
@@ -4114,7 +4114,7 @@ EXPLAIN (COSTS false) SELECT * FROM s1.t1
 EXPLAIN (COSTS false) SELECT * FROM s1.t1
   JOIN s1.t2 ON (t1.c1 = t2.c1)
   JOIN s1.t3 ON (t1.c1 = t3.c1);
-INFO:  hint syntax error at or near "Leading(t2 t3 t1)Leading(t1 t2 t3)"
+INFO:  pg_hint_plan: hint syntax error at or near "Leading(t2 t3 t1)Leading(t1 t2 t3)"
 DETAIL:  Conflict leading hint.
 LOG:  pg_hint_plan:
 used hint:
@@ -4142,9 +4142,9 @@ error hint:
 EXPLAIN (COSTS false) SELECT * FROM s1.t1
   JOIN s1.t2 ON (t1.c1 = t2.c1)
   JOIN s1.t3 ON (t1.c1 = t3.c1);
-INFO:  hint syntax error at or near "Leading(t3 t1 t2)Leading(t2 t3 t1)Leading(t1 t2 t3)"
+INFO:  pg_hint_plan: hint syntax error at or near "Leading(t3 t1 t2)Leading(t2 t3 t1)Leading(t1 t2 t3)"
 DETAIL:  Conflict leading hint.
-INFO:  hint syntax error at or near "Leading(t2 t3 t1)Leading(t1 t2 t3)"
+INFO:  pg_hint_plan: hint syntax error at or near "Leading(t2 t3 t1)Leading(t1 t2 t3)"
 DETAIL:  Conflict leading hint.
 LOG:  pg_hint_plan:
 used hint:
@@ -4173,7 +4173,7 @@ error hint:
 EXPLAIN (COSTS false) SELECT * FROM s1.t1
   JOIN s1.t2 ON (t1.c1 = t2.c1)
   JOIN s1.t3 ON (t1.c1 = t3.c1);
-INFO:  hint syntax error at or near "Leading()"
+INFO:  pg_hint_plan: hint syntax error at or near "Leading()"
 DETAIL:  Leading hint requires at least two relations.
 LOG:  pg_hint_plan:
 used hint:
@@ -4202,9 +4202,9 @@ Leading()
 EXPLAIN (COSTS false) SELECT * FROM s1.t1
   JOIN s1.t2 ON (t1.c1 = t2.c1)
   JOIN s1.t3 ON (t1.c1 = t3.c1);
-INFO:  hint syntax error at or near "Leading()"
+INFO:  pg_hint_plan: hint syntax error at or near "Leading()"
 DETAIL:  Leading hint requires at least two relations.
-INFO:  hint syntax error at or near "Leading(t3 t1 t2)Leading(t2 t3 t1)Leading()"
+INFO:  pg_hint_plan: hint syntax error at or near "Leading(t3 t1 t2)Leading(t2 t3 t1)Leading()"
 DETAIL:  Conflict leading hint.
 LOG:  pg_hint_plan:
 used hint:
@@ -4237,7 +4237,7 @@ Leading()
 EXPLAIN (COSTS false) SELECT * FROM s1.t1
   JOIN s1.t2 ON (t1.c1 = t2.c1)
   JOIN s1.t3 ON (t1.c1 = t3.c1);
-INFO:  hint syntax error at or near "Leading()"
+INFO:  pg_hint_plan: hint syntax error at or near "Leading()"
 DETAIL:  Leading hint requires at least two relations.
 LOG:  pg_hint_plan:
 used hint:
@@ -4264,7 +4264,7 @@ Leading()
 EXPLAIN (COSTS false) SELECT * FROM s1.t1
   JOIN s1.t2 ON (t1.c1 = t2.c1)
   JOIN s1.t3 ON (t1.c1 = t3.c1);
-INFO:  hint syntax error at or near "Leading(t1)"
+INFO:  pg_hint_plan: hint syntax error at or near "Leading(t1)"
 DETAIL:  Leading hint requires at least two relations.
 LOG:  pg_hint_plan:
 used hint:
@@ -4342,7 +4342,7 @@ error hint:
 -- No. L-3-6-1
 /*+Leading((t2))*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-INFO:  hint syntax error at or near "Leading((t2))"
+INFO:  pg_hint_plan: hint syntax error at or near "Leading((t2))"
 DETAIL:  Leading hint requires two sets of relations when parentheses nests.
 LOG:  pg_hint_plan:
 used hint:
@@ -4397,7 +4397,7 @@ error hint:
 -- No. L-3-6-3
 /*+Leading((t2 t3 t4))*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-INFO:  hint syntax error at or near "Leading((t2 t3 t4))"
+INFO:  pg_hint_plan: hint syntax error at or near "Leading((t2 t3 t4))"
 DETAIL:  Leading hint requires two sets of relations when parentheses nests.
 LOG:  pg_hint_plan:
 used hint:
@@ -4454,7 +4454,7 @@ error hint:
 -- No. L-3-6-5
 /*+Leading((((t1 t3) t4) t2)))*/
 EXPLAIN (COSTS false) SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-INFO:  hint syntax error at or near ")"
+INFO:  pg_hint_plan: hint syntax error at or near ")"
 DETAIL:  Unrecognized hint keyword ")".
 LOG:  pg_hint_plan:
 used hint:
index ce6438b..19a8e52 100644 (file)
@@ -137,7 +137,7 @@ error hint:
 EXPLAIN SELECT * FROM s1.t1, s2.t1 WHERE s1.t1.c1 = s2.t1.c1;
 /*+Rows(t1 t1 #1)*/
 EXPLAIN SELECT * FROM s1.t1, s2.t1 WHERE s1.t1.c1 = s2.t1.c1;
-INFO:  hint syntax error at or near "Rows(t1 t1 #1)"
+INFO:  pg_hint_plan: hint syntax error at or near "Rows(t1 t1 #1)"
 DETAIL:  Relation name "t1" is ambiguous.
 LOG:  pg_hint_plan:
 used hint:
@@ -214,7 +214,7 @@ error hint:
 \o results/R_1-5-2.out.log
 /*+Rows(t1 t1 #1)*/
 EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-INFO:  hint syntax error at or near "Rows(t1 t1 #1)"
+INFO:  pg_hint_plan: hint syntax error at or near "Rows(t1 t1 #1)"
 DETAIL:  Relation name "t1" is duplicated.
 LOG:  pg_hint_plan:
 used hint:
@@ -230,12 +230,12 @@ Rows(t1 t1 #1)
 \o results/R_1-5-3.out.log
 /*+(t1 t1)(t2 t2)*/
 EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-INFO:  hint syntax error at or near "(t1 t1)(t2 t2)"
+INFO:  pg_hint_plan: hint syntax error at or near "(t1 t1)(t2 t2)"
 DETAIL:  Unrecognized hint keyword "".
 EXPLAIN SELECT * FROM s1.t1, s1.t2, s1.t3 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1;
 /*+(t1 t2 t1 t2)*/
 EXPLAIN SELECT * FROM s1.t1, s1.t2, s1.t3, s1.t4 WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-INFO:  hint syntax error at or near "(t1 t2 t1 t2)"
+INFO:  pg_hint_plan: hint syntax error at or near "(t1 t2 t1 t2)"
 DETAIL:  Unrecognized hint keyword "".
 \o
 \! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_1-5-3.out.log > results/R_1-5-3.out
@@ -481,7 +481,7 @@ error hint:
 \o results/R_1-7-1.out.log
 /*+Rows(t1 #1)*/
 EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-INFO:  hint syntax error at or near ""
+INFO:  pg_hint_plan: hint syntax error at or near ""
 DETAIL:  Rows hint requires at least two relations.
 LOG:  pg_hint_plan:
 used hint:
@@ -497,7 +497,7 @@ Rows(t1 #1)
 \o results/R_1-7-2.out.log
 /*+Rows(t1 t2 1)*/
 EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-INFO:  hint syntax error at or near "1"
+INFO:  pg_hint_plan: hint syntax error at or near "1"
 DETAIL:  Unrecognized rows value type notation.
 LOG:  pg_hint_plan:
 used hint:
@@ -513,7 +513,7 @@ Rows(t1 t2 1)
 \o results/R_1-7-3.out.log
 /*+Rows(t1 t2 #notrows)*/
 EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-INFO:  hint syntax error at or near "notrows"
+INFO:  pg_hint_plan: hint syntax error at or near "notrows"
 DETAIL:  Rows hint requires valid number as rows estimation.
 LOG:  pg_hint_plan:
 used hint:
@@ -1963,7 +1963,7 @@ error hint:
 \o results/R_2-3-4.out.log
 /*+HashJoin(v1t1 v1t1)*/
 EXPLAIN SELECT * FROM s1.v1 v1, s1.v1 v2 WHERE v1.c1 = v2.c1;
-INFO:  hint syntax error at or near "HashJoin(v1t1 v1t1)"
+INFO:  pg_hint_plan: hint syntax error at or near "HashJoin(v1t1 v1t1)"
 DETAIL:  Relation name "v1t1" is ambiguous.
 LOG:  pg_hint_plan:
 used hint:
@@ -1974,9 +1974,9 @@ HashJoin(v1t1 v1t1)
 
 /*+HashJoin(v1t1 v1t1)Rows(v1t1 v1t1 #1)*/
 EXPLAIN SELECT * FROM s1.v1 v1, s1.v1 v2 WHERE v1.c1 = v2.c1;
-INFO:  hint syntax error at or near "HashJoin(v1t1 v1t1)Rows(v1t1 v1t1 #1)"
+INFO:  pg_hint_plan: hint syntax error at or near "HashJoin(v1t1 v1t1)Rows(v1t1 v1t1 #1)"
 DETAIL:  Relation name "v1t1" is ambiguous.
-INFO:  hint syntax error at or near "Rows(v1t1 v1t1 #1)"
+INFO:  pg_hint_plan: hint syntax error at or near "Rows(v1t1 v1t1 #1)"
 DETAIL:  Relation name "v1t1" is ambiguous.
 LOG:  pg_hint_plan:
 used hint:
@@ -2017,11 +2017,11 @@ error hint:
 \o results/R_2-3-6.out.log
 /*+RowsHashJoin(r4t1 r4t1)*/
 EXPLAIN SELECT * FROM s1.r4 t1, s1.r4 t2 WHERE t1.c1 = t2.c1;
-INFO:  hint syntax error at or near "RowsHashJoin(r4t1 r4t1)"
+INFO:  pg_hint_plan: hint syntax error at or near "RowsHashJoin(r4t1 r4t1)"
 DETAIL:  Unrecognized hint keyword "RowsHashJoin".
 /*+RowsHashJoin(r4t1 r4t1)Rows(r4t1 r4t1 #1)*/
 EXPLAIN SELECT * FROM s1.r4 t1, s1.r4 t2 WHERE t1.c1 = t2.c1;
-INFO:  hint syntax error at or near "RowsHashJoin(r4t1 r4t1)Rows(r4t1 r4t1 #1)"
+INFO:  pg_hint_plan: hint syntax error at or near "RowsHashJoin(r4t1 r4t1)Rows(r4t1 r4t1 #1)"
 DETAIL:  Unrecognized hint keyword "RowsHashJoin".
 \o
 \! sed 's/cost=[\.0-9]*/cost=xxx/' results/R_2-3-6.out.log > results/R_2-3-6.out
@@ -2098,11 +2098,11 @@ error hint:
 
 /*+ Leading(*VALUES* t3 t2 t1) Rows(t4 t3 #2)Rows(*VALUES* t3 t2 #2)Rows(*VALUES* t3 t2 t1 #2)*/
 EXPLAIN SELECT * FROM s1.t1, s1.t2, (VALUES(1,1,1,'1')) AS t3 (c1, c2, c3, c4), (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t4 (c1, c2, c3, c4) WHERE t1.c1 = t2.c1 AND t1.c1 = t3.c1 AND t1.c1 = t4.c1;
-INFO:  hint syntax error at or near "Rows(*VALUES* t3 t2 #2)Rows(*VALUES* t3 t2 t1 #2)"
+INFO:  pg_hint_plan: hint syntax error at or near "Rows(*VALUES* t3 t2 #2)Rows(*VALUES* t3 t2 t1 #2)"
 DETAIL:  Relation name "*VALUES*" is ambiguous.
-INFO:  hint syntax error at or near "Rows(*VALUES* t3 t2 t1 #2)"
+INFO:  pg_hint_plan: hint syntax error at or near "Rows(*VALUES* t3 t2 t1 #2)"
 DETAIL:  Relation name "*VALUES*" is ambiguous.
-INFO:  hint syntax error at or near "Leading(*VALUES* t3 t2 t1) Rows(t4 t3 #2)Rows(*VALUES* t3 t2 #2)Rows(*VALUES* t3 t2 t1 #2)"
+INFO:  pg_hint_plan: hint syntax error at or near "Leading(*VALUES* t3 t2 t1) Rows(t4 t3 #2)Rows(*VALUES* t3 t2 #2)Rows(*VALUES* t3 t2 t1 #2)"
 DETAIL:  Relation name "*VALUES*" is ambiguous.
 LOG:  pg_hint_plan:
 used hint:
@@ -2342,7 +2342,7 @@ error hint:
 EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
 /*+Rows(t1 t2 #1)Rows(t1 t2 #1)*/
 EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-INFO:  hint syntax error at or near "Rows(t1 t2 #1)Rows(t1 t2 #1)"
+INFO:  pg_hint_plan: hint syntax error at or near "Rows(t1 t2 #1)Rows(t1 t2 #1)"
 DETAIL:  Conflict rows hint.
 LOG:  pg_hint_plan:
 used hint:
@@ -2360,9 +2360,9 @@ error hint:
 EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
 /*+Rows(t1 t2 #1)Rows(t1 t2 #1)Rows(t1 t2 #1)*/
 EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-INFO:  hint syntax error at or near "Rows(t1 t2 #1)Rows(t1 t2 #1)Rows(t1 t2 #1)"
+INFO:  pg_hint_plan: hint syntax error at or near "Rows(t1 t2 #1)Rows(t1 t2 #1)Rows(t1 t2 #1)"
 DETAIL:  Conflict rows hint.
-INFO:  hint syntax error at or near "Rows(t1 t2 #1)Rows(t1 t2 #1)"
+INFO:  pg_hint_plan: hint syntax error at or near "Rows(t1 t2 #1)Rows(t1 t2 #1)"
 DETAIL:  Conflict rows hint.
 LOG:  pg_hint_plan:
 used hint:
@@ -2381,7 +2381,7 @@ error hint:
 EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
 /*+Rows(t1 t2 #1)Rows(t2 t1 #1)*/
 EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-INFO:  hint syntax error at or near "Rows(t1 t2 #1)Rows(t2 t1 #1)"
+INFO:  pg_hint_plan: hint syntax error at or near "Rows(t1 t2 #1)Rows(t2 t1 #1)"
 DETAIL:  Conflict rows hint.
 LOG:  pg_hint_plan:
 used hint:
@@ -2399,9 +2399,9 @@ error hint:
 EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
 /*+Rows(t2 t1 #1)Rows(t1 t2 #1)Rows(t2 t1 #1)*/
 EXPLAIN SELECT * FROM s1.t1, s1.t2 WHERE t1.c1 = t2.c1;
-INFO:  hint syntax error at or near "Rows(t2 t1 #1)Rows(t1 t2 #1)Rows(t2 t1 #1)"
+INFO:  pg_hint_plan: hint syntax error at or near "Rows(t2 t1 #1)Rows(t1 t2 #1)Rows(t2 t1 #1)"
 DETAIL:  Conflict rows hint.
-INFO:  hint syntax error at or near "Rows(t1 t2 #1)Rows(t2 t1 #1)"
+INFO:  pg_hint_plan: hint syntax error at or near "Rows(t1 t2 #1)Rows(t2 t1 #1)"
 DETAIL:  Conflict rows hint.
 LOG:  pg_hint_plan:
 used hint:
index 4127546..66e2774 100644 (file)
@@ -3037,7 +3037,7 @@ EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1')) AS t1 (c1, c2, c3, c4),
 
 /*+SeqScan(t1 t2)*/
 EXPLAIN (COSTS false) SELECT * FROM (VALUES(1,1,1,'1')) AS t1 (c1, c2, c3, c4), (VALUES(1,1,1,'1'), (2,2,2,'2')) AS t2 (c1, c2) WHERE t1.c1 = t2.c1;
-INFO:  hint syntax error at or near ""
+INFO:  pg_hint_plan: hint syntax error at or near ""
 DETAIL:  SeqScan hint accepts only one relation.
 LOG:  pg_hint_plan:
 used hint:
@@ -5332,7 +5332,7 @@ error hint:
 -- No. S-3-12-1
 /*+IndexScan(ti1) BitmapScan(ti1)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-INFO:  hint syntax error at or near "IndexScan(ti1) BitmapScan(ti1)"
+INFO:  pg_hint_plan: hint syntax error at or near "IndexScan(ti1) BitmapScan(ti1)"
 DETAIL:  Conflict scan method hint.
 LOG:  pg_hint_plan:
 used hint:
@@ -5354,7 +5354,7 @@ error hint:
 -- No. S-3-12-2
 /*+IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-INFO:  hint syntax error at or near "IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)"
+INFO:  pg_hint_plan: hint syntax error at or near "IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)"
 DETAIL:  Conflict scan method hint.
 LOG:  available indexes for BitmapScan(ti1): ti1_btree
 LOG:  pg_hint_plan:
@@ -5377,9 +5377,9 @@ error hint:
 -- No. S-3-12-3
 /*+BitmapScan(ti1) IndexScan(ti1) BitmapScan(ti1)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-INFO:  hint syntax error at or near "BitmapScan(ti1) IndexScan(ti1) BitmapScan(ti1)"
+INFO:  pg_hint_plan: hint syntax error at or near "BitmapScan(ti1) IndexScan(ti1) BitmapScan(ti1)"
 DETAIL:  Conflict scan method hint.
-INFO:  hint syntax error at or near "IndexScan(ti1) BitmapScan(ti1)"
+INFO:  pg_hint_plan: hint syntax error at or near "IndexScan(ti1) BitmapScan(ti1)"
 DETAIL:  Conflict scan method hint.
 LOG:  pg_hint_plan:
 used hint:
@@ -5402,9 +5402,9 @@ error hint:
 -- No. S-3-12-4
 /*+BitmapScan(ti1 ti1_hash) IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-INFO:  hint syntax error at or near "BitmapScan(ti1 ti1_hash) IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)"
+INFO:  pg_hint_plan: hint syntax error at or near "BitmapScan(ti1 ti1_hash) IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)"
 DETAIL:  Conflict scan method hint.
-INFO:  hint syntax error at or near "IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)"
+INFO:  pg_hint_plan: hint syntax error at or near "IndexScan(ti1 ti1_pkey) BitmapScan(ti1 ti1_btree)"
 DETAIL:  Conflict scan method hint.
 LOG:  available indexes for BitmapScan(ti1): ti1_btree
 LOG:  pg_hint_plan:
@@ -5447,7 +5447,7 @@ error hint:
 -- No. S-3-13-2
 /*+SeqScan(ti1 ti1_pkey)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-INFO:  hint syntax error at or near ""
+INFO:  pg_hint_plan: hint syntax error at or near ""
 DETAIL:  SeqScan hint accepts only one relation.
 LOG:  pg_hint_plan:
 used hint:
@@ -5466,7 +5466,7 @@ SeqScan(ti1 ti1_pkey)
 -- No. S-3-13-3
 /*+SeqScan(ti1 ti1_pkey ti1_btree)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-INFO:  hint syntax error at or near ""
+INFO:  pg_hint_plan: hint syntax error at or near ""
 DETAIL:  SeqScan hint accepts only one relation.
 LOG:  pg_hint_plan:
 used hint:
@@ -5614,7 +5614,7 @@ error hint:
 -- No. S-3-13-11
 /*+TidScan(ti1 ti1_pkey)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-INFO:  hint syntax error at or near ""
+INFO:  pg_hint_plan: hint syntax error at or near ""
 DETAIL:  TidScan hint accepts only one relation.
 LOG:  pg_hint_plan:
 used hint:
@@ -5633,7 +5633,7 @@ TidScan(ti1 ti1_pkey)
 -- No. S-3-13-12
 /*+TidScan(ti1 ti1_pkey ti1_btree)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-INFO:  hint syntax error at or near ""
+INFO:  pg_hint_plan: hint syntax error at or near ""
 DETAIL:  TidScan hint accepts only one relation.
 LOG:  pg_hint_plan:
 used hint:
@@ -5669,7 +5669,7 @@ error hint:
 -- No. S-3-13-14
 /*+NoSeqScan(ti1 ti1_pkey)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-INFO:  hint syntax error at or near ""
+INFO:  pg_hint_plan: hint syntax error at or near ""
 DETAIL:  NoSeqScan hint accepts only one relation.
 LOG:  pg_hint_plan:
 used hint:
@@ -5688,7 +5688,7 @@ NoSeqScan(ti1 ti1_pkey)
 -- No. S-3-13-15
 /*+NoSeqScan(ti1 ti1_pkey ti1_btree)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-INFO:  hint syntax error at or near ""
+INFO:  pg_hint_plan: hint syntax error at or near ""
 DETAIL:  NoSeqScan hint accepts only one relation.
 LOG:  pg_hint_plan:
 used hint:
@@ -5724,7 +5724,7 @@ error hint:
 -- No. S-3-13-17
 /*+NoIndexScan(ti1 ti1_pkey)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-INFO:  hint syntax error at or near ""
+INFO:  pg_hint_plan: hint syntax error at or near ""
 DETAIL:  NoIndexScan hint accepts only one relation.
 LOG:  pg_hint_plan:
 used hint:
@@ -5743,7 +5743,7 @@ NoIndexScan(ti1 ti1_pkey)
 -- No. S-3-13-18
 /*+NoIndexScan(ti1 ti1_pkey ti1_btree)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-INFO:  hint syntax error at or near ""
+INFO:  pg_hint_plan: hint syntax error at or near ""
 DETAIL:  NoIndexScan hint accepts only one relation.
 LOG:  pg_hint_plan:
 used hint:
@@ -5779,7 +5779,7 @@ error hint:
 -- No. S-3-13-20
 /*+NoBitmapScan(ti1 ti1_pkey)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-INFO:  hint syntax error at or near ""
+INFO:  pg_hint_plan: hint syntax error at or near ""
 DETAIL:  NoBitmapScan hint accepts only one relation.
 LOG:  pg_hint_plan:
 used hint:
@@ -5798,7 +5798,7 @@ NoBitmapScan(ti1 ti1_pkey)
 -- No. S-3-13-21
 /*+NoBitmapScan(ti1 ti1_pkey ti1_btree)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-INFO:  hint syntax error at or near ""
+INFO:  pg_hint_plan: hint syntax error at or near ""
 DETAIL:  NoBitmapScan hint accepts only one relation.
 LOG:  pg_hint_plan:
 used hint:
@@ -5834,7 +5834,7 @@ error hint:
 -- No. S-3-13-23
 /*+NoTidScan(ti1 ti1_pkey)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-INFO:  hint syntax error at or near ""
+INFO:  pg_hint_plan: hint syntax error at or near ""
 DETAIL:  NoTidScan hint accepts only one relation.
 LOG:  pg_hint_plan:
 used hint:
@@ -5853,7 +5853,7 @@ NoTidScan(ti1 ti1_pkey)
 -- No. S-3-13-24
 /*+NoTidScan(ti1 ti1_pkey ti1_btree)*/
 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 = 1 AND ctid = '(1,1)';
-INFO:  hint syntax error at or near ""
+INFO:  pg_hint_plan: hint syntax error at or near ""
 DETAIL:  NoTidScan hint accepts only one relation.
 LOG:  pg_hint_plan:
 used hint:
@@ -5938,7 +5938,7 @@ error hint:
 -- No. S-3-13-29
 /*+NoIndexOnlyScan(ti1 ti1_pkey)*/
 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 = 1;
-INFO:  hint syntax error at or near ""
+INFO:  pg_hint_plan: hint syntax error at or near ""
 DETAIL:  NoIndexOnlyScan hint accepts only one relation.
 LOG:  pg_hint_plan:
 used hint:
@@ -5956,7 +5956,7 @@ NoIndexOnlyScan(ti1 ti1_pkey)
 -- No. S-3-13-30
 /*+NoIndexOnlyScan(ti1 ti1_pkey ti1_btree)*/
 EXPLAIN (COSTS false) SELECT c1 FROM s1.ti1 WHERE c1 = 1;
-INFO:  hint syntax error at or near ""
+INFO:  pg_hint_plan: hint syntax error at or near ""
 DETAIL:  NoIndexOnlyScan hint accepts only one relation.
 LOG:  pg_hint_plan:
 used hint:
index 8e85100..f144e93 100644 (file)
@@ -93,8 +93,9 @@ PG_MODULE_MAGIC;
 #define HINT_ARRAY_DEFAULT_INITSIZE 8
 
 #define hint_ereport(str, detail) \
-       ereport(pg_hint_plan_parse_messages, \
-                       (errmsg("hint syntax error at or near \"%s\"", (str)), \
+       ereport(pg_hint_plan_message_level, \
+                       (errhidestmt(hidestmt), \
+                        errmsg("pg_hint_plan%s: hint syntax error at or near \"%s\"", qnostr, (str)), \
                         errdetail detail))
 
 #define skip_space(str) \
@@ -159,7 +160,7 @@ typedef Hint *(*HintCreateFunction) (const char *hint_str,
                                                                         const char *keyword,
                                                                         HintKeyword hint_keyword);
 typedef void (*HintDeleteFunction) (Hint *hint);
-typedef void (*HintDescFunction) (Hint *hint, StringInfo buf);
+typedef void (*HintDescFunction) (Hint *hint, StringInfo buf, bool nolf);
 typedef int (*HintCmpFunction) (const Hint *a, const Hint *b);
 typedef const char *(*HintParseFunction) (Hint *hint, HintState *hstate,
                                                                                  Query *parse, const char *str);
@@ -196,6 +197,9 @@ typedef enum HintStatus
 #define hint_state_enabled(hint) ((hint)->base.state == HINT_STATE_NOTUSED || \
                                                                  (hint)->base.state == HINT_STATE_USED)
 
+static unsigned int qno = 0;
+static char qnostr[32];
+
 /* common data for all hints. */
 struct Hint
 {
@@ -360,35 +364,35 @@ static RelOptInfo *pg_hint_plan_join_search(PlannerInfo *root,
 static Hint *ScanMethodHintCreate(const char *hint_str, const char *keyword,
                                                                  HintKeyword hint_keyword);
 static void ScanMethodHintDelete(ScanMethodHint *hint);
-static void ScanMethodHintDesc(ScanMethodHint *hint, StringInfo buf);
+static void ScanMethodHintDesc(ScanMethodHint *hint, StringInfo buf, bool nolf);
 static int ScanMethodHintCmp(const ScanMethodHint *a, const ScanMethodHint *b);
 static const char *ScanMethodHintParse(ScanMethodHint *hint, HintState *hstate,
                                                                           Query *parse, const char *str);
 static Hint *JoinMethodHintCreate(const char *hint_str, const char *keyword,
                                                                  HintKeyword hint_keyword);
 static void JoinMethodHintDelete(JoinMethodHint *hint);
-static void JoinMethodHintDesc(JoinMethodHint *hint, StringInfo buf);
+static void JoinMethodHintDesc(JoinMethodHint *hint, StringInfo buf, bool nolf);
 static int JoinMethodHintCmp(const JoinMethodHint *a, const JoinMethodHint *b);
 static const char *JoinMethodHintParse(JoinMethodHint *hint, HintState *hstate,
                                                                           Query *parse, const char *str);
 static Hint *LeadingHintCreate(const char *hint_str, const char *keyword,
                                                           HintKeyword hint_keyword);
 static void LeadingHintDelete(LeadingHint *hint);
-static void LeadingHintDesc(LeadingHint *hint, StringInfo buf);
+static void LeadingHintDesc(LeadingHint *hint, StringInfo buf, bool nolf);
 static int LeadingHintCmp(const LeadingHint *a, const LeadingHint *b);
 static const char *LeadingHintParse(LeadingHint *hint, HintState *hstate,
                                                                        Query *parse, const char *str);
 static Hint *SetHintCreate(const char *hint_str, const char *keyword,
                                                   HintKeyword hint_keyword);
 static void SetHintDelete(SetHint *hint);
-static void SetHintDesc(SetHint *hint, StringInfo buf);
+static void SetHintDesc(SetHint *hint, StringInfo buf, bool nolf);
 static int SetHintCmp(const SetHint *a, const SetHint *b);
 static const char *SetHintParse(SetHint *hint, HintState *hstate, Query *parse,
                                                                const char *str);
 static Hint *RowsHintCreate(const char *hint_str, const char *keyword,
                                                        HintKeyword hint_keyword);
 static void RowsHintDelete(RowsHint *hint);
-static void RowsHintDesc(RowsHint *hint, StringInfo buf);
+static void RowsHintDesc(RowsHint *hint, StringInfo buf, bool nolf);
 static int RowsHintCmp(const RowsHint *a, const RowsHint *b);
 static const char *RowsHintParse(RowsHint *hint, HintState *hstate,
                                                                 Query *parse, const char *str);
@@ -429,10 +433,11 @@ static void pg_hint_plan_plpgsql_stmt_end(PLpgSQL_execstate *estate,
 
 /* GUC variables */
 static bool    pg_hint_plan_enable_hint = true;
-static bool    pg_hint_plan_debug_print = false;
-static int     pg_hint_plan_parse_messages = INFO;
+static int debug_level = 0;
+static int     pg_hint_plan_message_level = INFO;
 /* Default is off, to keep backward compatibility. */
 static bool    pg_hint_plan_enable_hint_table = false;
+static bool    hidestmt = false;
 
 static const struct config_enum_entry parse_messages_level_options[] = {
        {"debug", DEBUG2, true},
@@ -453,6 +458,22 @@ static const struct config_enum_entry parse_messages_level_options[] = {
        {NULL, 0, false}
 };
 
+static const struct config_enum_entry parse_debug_level_options[] = {
+       {"off", 0, false},
+       {"on", 1, false},
+       {"detailed", 2, false},
+       {"verbose", 3, false},
+       {"0", 0, true},
+       {"1", 1, true},
+       {"2", 2, true},
+       {"3", 3, true},
+       {"no", 0, true},
+       {"yes", 1, true},
+       {"false", 0, true},
+       {"true", 1, true},
+       {NULL, 0, false}
+};
+
 /* Saved hook values in case of unload */
 static ProcessUtility_hook_type prev_ProcessUtility = NULL;
 static planner_hook_type prev_planner = NULL;
@@ -534,17 +555,18 @@ _PG_init(void)
                                                         NULL,
                                                         &pg_hint_plan_enable_hint,
                                                         true,
-                                                        PGC_USERSET,
+                                                    PGC_USERSET,
                                                         0,
                                                         NULL,
                                                         NULL,
                                                         NULL);
 
-       DefineCustomBoolVariable("pg_hint_plan.debug_print",
+       DefineCustomEnumVariable("pg_hint_plan.debug_print",
                                                         "Logs results of hint parsing.",
                                                         NULL,
-                                                        &pg_hint_plan_debug_print,
+                                                        &debug_level,
                                                         false,
+                                                        parse_debug_level_options,
                                                         PGC_USERSET,
                                                         0,
                                                         NULL,
@@ -554,7 +576,19 @@ _PG_init(void)
        DefineCustomEnumVariable("pg_hint_plan.parse_messages",
                                                         "Message level of parse errors.",
                                                         NULL,
-                                                        &pg_hint_plan_parse_messages,
+                                                        &pg_hint_plan_message_level,
+                                                        INFO,
+                                                        parse_messages_level_options,
+                                                        PGC_USERSET,
+                                                        0,
+                                                        NULL,
+                                                        NULL,
+                                                        NULL);
+
+       DefineCustomEnumVariable("pg_hint_plan.message_level",
+                                                        "Message level of debug messages.",
+                                                        NULL,
+                                                        &pg_hint_plan_message_level,
                                                         INFO,
                                                         parse_messages_level_options,
                                                         PGC_USERSET,
@@ -893,7 +927,7 @@ quote_value(StringInfo buf, const char *value)
 }
 
 static void
-ScanMethodHintDesc(ScanMethodHint *hint, StringInfo buf)
+ScanMethodHintDesc(ScanMethodHint *hint, StringInfo buf, bool nolf)
 {
        ListCell   *l;
 
@@ -907,11 +941,13 @@ ScanMethodHintDesc(ScanMethodHint *hint, StringInfo buf)
                        quote_value(buf, (char *) lfirst(l));
                }
        }
-       appendStringInfoString(buf, ")\n");
+       appendStringInfoString(buf, ")");
+       if (!nolf)
+               appendStringInfoChar(buf, '\n');
 }
 
 static void
-JoinMethodHintDesc(JoinMethodHint *hint, StringInfo buf)
+JoinMethodHintDesc(JoinMethodHint *hint, StringInfo buf, bool nolf)
 {
        int     i;
 
@@ -925,8 +961,9 @@ JoinMethodHintDesc(JoinMethodHint *hint, StringInfo buf)
                        quote_value(buf, hint->relnames[i]);
                }
        }
-       appendStringInfoString(buf, ")\n");
-
+       appendStringInfoString(buf, ")");
+       if (!nolf)
+               appendStringInfoChar(buf, '\n');
 }
 
 static void
@@ -957,7 +994,7 @@ OuterInnerDesc(OuterInnerRels *outer_inner, StringInfo buf)
 }
 
 static void
-LeadingHintDesc(LeadingHint *hint, StringInfo buf)
+LeadingHintDesc(LeadingHint *hint, StringInfo buf, bool nolf)
 {
        appendStringInfo(buf, "%s(", HINT_LEADING);
        if (hint->outer_inner == NULL)
@@ -980,11 +1017,13 @@ LeadingHintDesc(LeadingHint *hint, StringInfo buf)
        else
                OuterInnerDesc(hint->outer_inner, buf);
 
-       appendStringInfoString(buf, ")\n");
+       appendStringInfoString(buf, ")");
+       if (!nolf)
+               appendStringInfoChar(buf, '\n');
 }
 
 static void
-SetHintDesc(SetHint *hint, StringInfo buf)
+SetHintDesc(SetHint *hint, StringInfo buf, bool nolf)
 {
        bool            is_first = true;
        ListCell   *l;
@@ -999,11 +1038,13 @@ SetHintDesc(SetHint *hint, StringInfo buf)
 
                quote_value(buf, (char *) lfirst(l));
        }
-       appendStringInfo(buf, ")\n");
+       appendStringInfo(buf, ")");
+       if (!nolf)
+               appendStringInfoChar(buf, '\n');
 }
 
 static void
-RowsHintDesc(RowsHint *hint, StringInfo buf)
+RowsHintDesc(RowsHint *hint, StringInfo buf, bool nolf)
 {
        int     i;
 
@@ -1018,8 +1059,9 @@ RowsHintDesc(RowsHint *hint, StringInfo buf)
                }
        }
        appendStringInfo(buf, " %s", hint->rows_str);
-       appendStringInfoString(buf, ")\n");
-
+       appendStringInfoString(buf, ")");
+       if (!nolf)
+               appendStringInfoChar(buf, '\n');
 }
 
 /*
@@ -1028,18 +1070,26 @@ RowsHintDesc(RowsHint *hint, StringInfo buf)
  */
 static void
 desc_hint_in_state(HintState *hstate, StringInfo buf, const char *title,
-                                       HintStatus state)
+                                  HintStatus state, bool nolf)
 {
-       int     i;
+       int     i, nshown;
+
+       appendStringInfo(buf, "%s:", title);
+       if (!nolf)
+               appendStringInfoChar(buf, '\n');
 
-       appendStringInfo(buf, "%s:\n", title);
+       nshown = 0;
        for (i = 0; i < hstate->nall_hints; i++)
        {
                if (hstate->all_hints[i]->state != state)
                        continue;
 
-               hstate->all_hints[i]->desc_func(hstate->all_hints[i], buf);
+               hstate->all_hints[i]->desc_func(hstate->all_hints[i], buf, nolf);
+               nshown++;
        }
+
+       if (nolf && nshown == 0)
+               appendStringInfoString(buf, "(none)");
 }
 
 /*
@@ -1059,16 +1109,43 @@ HintStateDump(HintState *hstate)
        initStringInfo(&buf);
 
        appendStringInfoString(&buf, "pg_hint_plan:\n");
-       desc_hint_in_state(hstate, &buf, "used hint", HINT_STATE_USED);
-       desc_hint_in_state(hstate, &buf, "not used hint", HINT_STATE_NOTUSED);
-       desc_hint_in_state(hstate, &buf, "duplication hint", HINT_STATE_DUPLICATION);
-       desc_hint_in_state(hstate, &buf, "error hint", HINT_STATE_ERROR);
+       desc_hint_in_state(hstate, &buf, "used hint", HINT_STATE_USED, false);
+       desc_hint_in_state(hstate, &buf, "not used hint", HINT_STATE_NOTUSED, false);
+       desc_hint_in_state(hstate, &buf, "duplication hint", HINT_STATE_DUPLICATION, false);
+       desc_hint_in_state(hstate, &buf, "error hint", HINT_STATE_ERROR, false);
 
        elog(LOG, "%s", buf.data);
 
        pfree(buf.data);
 }
 
+static void
+HintStateDump2(HintState *hstate)
+{
+       StringInfoData  buf;
+
+       if (!hstate)
+       {
+               elog(pg_hint_plan_message_level,
+                        "pg_hint_plan%s: HintStateDump:\nno hint", qnostr);
+               return;
+       }
+
+       initStringInfo(&buf);
+       appendStringInfo(&buf, "pg_hint_plan%s: HintStateDump: ", qnostr);
+       desc_hint_in_state(hstate, &buf, "{used hints", HINT_STATE_USED, true);
+       desc_hint_in_state(hstate, &buf, "}, {not used hints", HINT_STATE_NOTUSED, true);
+       desc_hint_in_state(hstate, &buf, "}, {duplicate hints", HINT_STATE_DUPLICATION, true);
+       desc_hint_in_state(hstate, &buf, "}, {error hints", HINT_STATE_ERROR, true);
+       appendStringInfoChar(&buf, '}');
+
+       ereport(pg_hint_plan_message_level,
+                       (errhidestmt(true),
+                        errmsg("%s", buf.data)));
+
+       pfree(buf.data);
+}
+
 /*
  * compare functions
  */
@@ -2145,10 +2222,12 @@ set_config_option_wrapper(const char *name, const char *value,
                errdata = CopyErrorData();
                FlushErrorState();
 
-               ereport(elevel, (errcode(errdata->sqlerrcode),
-                               errmsg("%s", errdata->message),
-                               errdata->detail ? errdetail("%s", errdata->detail) : 0,
-                               errdata->hint ? errhint("%s", errdata->hint) : 0));
+               ereport(elevel,
+                               (errcode(errdata->sqlerrcode),
+                                errhidestmt(hidestmt),
+                                errmsg("%s", errdata->message),
+                                errdata->detail ? errdetail("%s", errdata->detail) : 0,
+                                errdata->hint ? errhint("%s", errdata->hint) : 0));
                FreeErrorData(errdata);
        }
        PG_END_TRY();
@@ -2174,7 +2253,7 @@ set_config_options(SetHint **options, int noptions, GucContext context)
 
                result = set_config_option_wrapper(hint->name, hint->value, context,
                                                                                   PGC_S_SESSION, GUC_ACTION_SAVE, true,
-                                                                                  pg_hint_plan_parse_messages);
+                                                                                  pg_hint_plan_message_level);
                if (result != 0)
                        hint->base.state = HINT_STATE_USED;
                else
@@ -2243,6 +2322,10 @@ pg_hint_plan_ProcessUtility(Node *parsetree, const char *queryString,
         */
        if (!pg_hint_plan_enable_hint || nested_level > 0)
        {
+               if (debug_level > 1)
+                       ereport(pg_hint_plan_message_level,
+                                       (errmsg ("pg_hint_plan: ProcessUtility:"
+                                                        " pg_hint_plan.enable_hint = off")));
                if (prev_ProcessUtility)
                        (*prev_ProcessUtility) (parsetree, queryString,
                                                                        context, params,
@@ -2308,6 +2391,12 @@ pg_hint_plan_ProcessUtility(Node *parsetree, const char *queryString,
 
        if (stmt_name)
        {
+               if (debug_level > 1)
+                       ereport(pg_hint_plan_message_level,
+                                       (errmsg ("pg_hint_plan: ProcessUtility:"
+                                                        " stmt_name = \"%s\", statement=\"%s\"",
+                                                        stmt_name, queryString)));
+
                PG_TRY();
                {
                        if (prev_ProcessUtility)
@@ -2386,6 +2475,13 @@ pg_hint_plan_planner(Query *parse, int cursorOptions, ParamListInfo boundParams)
        int                             save_nestlevel;
        PlannedStmt        *result;
        HintState          *hstate;
+       char                    msgstr[1024];
+
+       qnostr[0] = 0;
+       strcpy(msgstr, "");
+       if (debug_level > 1)
+               snprintf(qnostr, sizeof(qnostr), "[qno=0x%x]", qno++);
+       hidestmt = false;
 
        /*
         * Use standard planner if pg_hint_plan is disabled or current nesting 
@@ -2393,7 +2489,16 @@ pg_hint_plan_planner(Query *parse, int cursorOptions, ParamListInfo boundParams)
         * plan with current_hint if any, so set it to NULL.
         */
        if (!pg_hint_plan_enable_hint || nested_level > 0)
+       {
+               if (debug_level > 1)
+                       elog(pg_hint_plan_message_level,
+                                "pg_hint_plan%s: planner: enable_hint=%d,"
+                                " nested_level=%d",
+                                qnostr, pg_hint_plan_enable_hint, nested_level);
+               hidestmt = true;
+
                goto standard_planner_proc;
+       }
 
        /* Create hint struct from client-supplied query string. */
        query = get_query_string();
@@ -2438,12 +2543,41 @@ pg_hint_plan_planner(Query *parse, int cursorOptions, ParamListInfo boundParams)
                                                                                           &query_len,
                                                                                           GetDatabaseEncoding());
                hints = get_hints_from_table(norm_query, application_name);
-               elog(DEBUG1,
-                        "pg_hint_plan: get_hints_from_table [%s][%s]=>[%s]",
-                        norm_query, application_name, hints ? hints : "(none)");
+               if (debug_level > 1)
+               {
+                       if (hints)
+                               snprintf(msgstr, 1024, "hints from table: \"%s\":"
+                                                " normalzed_query=\"%s\", application name =\"%s\"",
+                                                hints, norm_query, application_name);
+                       else
+                       {
+                               ereport(pg_hint_plan_message_level,
+                                               (errhidestmt(hidestmt),
+                                                errmsg("pg_hint_plan%s:"
+                                                               " no match found in table:"
+                                                               "  application name = \"%s\","
+                                                               " normalzed_query=\"%s\"",
+                                                               qnostr, application_name, norm_query)));
+                               hidestmt = true;
+                       }
+               }
        }
        if (hints == NULL)
+       {
                hints = get_hints_from_comment(query);
+
+               if (debug_level > 1)
+               {
+                       snprintf(msgstr, 1024, "hints in comment=\"%s\"",
+                                        hints ? hints : "(none)");
+                       if (debug_level > 2 || 
+                               stmt_name || strcmp(query, debug_query_string))
+                               snprintf(msgstr + strlen(msgstr), 1024- strlen(msgstr), 
+                                        ", stmt=\"%s\", query=\"%s\", debug_query_string=\"%s\"",
+                                                stmt_name, query, debug_query_string);
+               }
+       }
+
        hstate = create_hintstate(parse, hints);
 
        /*
@@ -2481,6 +2615,15 @@ pg_hint_plan_planner(Query *parse, int cursorOptions, ParamListInfo boundParams)
        if (enable_hashjoin)
                current_hint->init_join_mask |= ENABLE_HASHJOIN;
 
+       if (debug_level > 1)
+       {
+               ereport(pg_hint_plan_message_level,
+                               (errhidestmt(hidestmt),
+                                errmsg("pg_hint_plan%s: planner: %s",
+                                               qnostr, msgstr))); 
+               hidestmt = true;
+       }
+
        /*
         * Use PG_TRY mechanism to recover GUC parameters and current_hint to the
         * state when this planner started when error occurred in planner.
@@ -2505,8 +2648,10 @@ pg_hint_plan_planner(Query *parse, int cursorOptions, ParamListInfo boundParams)
        PG_END_TRY();
 
        /* Print hint in debug mode. */
-       if (pg_hint_plan_debug_print)
+       if (debug_level == 1)
                HintStateDump(current_hint);
+       else if (debug_level > 1)
+               HintStateDump2(current_hint);
 
        /*
         * Rollback changes of GUC parameters, and pop current hint context from
@@ -2518,6 +2663,14 @@ pg_hint_plan_planner(Query *parse, int cursorOptions, ParamListInfo boundParams)
        return result;
 
 standard_planner_proc:
+       if (debug_level > 1)
+       {
+               ereport(pg_hint_plan_message_level,
+                               (errhidestmt(hidestmt),
+                                errmsg("pg_hint_plan%s: planner: no valid hint (%s)",
+                                               qnostr, msgstr)));
+               hidestmt = true;
+       }
        current_hint = NULL;
        if (prev_planner)
                return (*prev_planner) (parse, cursorOptions, boundParams);
@@ -2624,7 +2777,7 @@ delete_indexes(ScanMethodHint *hint, RelOptInfo *rel, Oid relationObjectId)
         * other than it.
         */
        prev = NULL;
-       if (pg_hint_plan_debug_print)
+       if (debug_level > 0)
                initStringInfo(&buf);
 
        for (cell = list_head(rel->indexlist); cell; cell = next)
@@ -2649,7 +2802,7 @@ delete_indexes(ScanMethodHint *hint, RelOptInfo *rel, Oid relationObjectId)
                        if (result)
                        {
                                use_index = true;
-                               if (pg_hint_plan_debug_print)
+                               if (debug_level > 0)
                                {
                                        appendStringInfoCharMacro(&buf, ' ');
                                        quote_value(&buf, indexname);
@@ -2808,7 +2961,7 @@ delete_indexes(ScanMethodHint *hint, RelOptInfo *rel, Oid relationObjectId)
                                use_index = true;
 
                                /* to log the candidate of index */
-                               if (pg_hint_plan_debug_print)
+                               if (debug_level > 0)
                                {
                                        appendStringInfoCharMacro(&buf, ' ');
                                        quote_value(&buf, indexname);
@@ -2826,7 +2979,7 @@ delete_indexes(ScanMethodHint *hint, RelOptInfo *rel, Oid relationObjectId)
                pfree(indexname);
        }
 
-       if (pg_hint_plan_debug_print)
+       if (debug_level == 1)
        {
                char   *relname;
                StringInfoData  rel_buf;
@@ -2944,7 +3097,18 @@ pg_hint_plan_get_relation_info(PlannerInfo *root, Oid relationObjectId,
         * nesting depth is at SPI calls.
         */
        if (!current_hint || nested_level > 0)
+       {
+               if (debug_level > 1)
+                       ereport(pg_hint_plan_message_level,
+                                       (errhidestmt(true),
+                                        errmsg ("pg_hint_plan%s: get_relation_info"
+                                                        " no hint to apply: relation=%u(%s), inhparent=%d,"
+                                                        " current_hint=%p, nested_level=%d",
+                                                        qnostr, relationObjectId,
+                                                        get_rel_name(relationObjectId),
+                                                        inhparent, current_hint, nested_level)));
                return;
+       }
 
        /*
         * We could register the parent relation of the following children here
@@ -2954,7 +3118,18 @@ pg_hint_plan_get_relation_info(PlannerInfo *root, Oid relationObjectId,
         * called for them.
         */
        if (inhparent)
+       {
+               if (debug_level > 1)
+                       ereport(pg_hint_plan_message_level,
+                                       (errhidestmt(true),
+                                        errmsg ("pg_hint_plan%s: get_relation_info"
+                                                        " skipping inh parent: relation=%u(%s), inhparent=%d,"
+                                                        " current_hint=%p, nested_level=%d",
+                                                        qnostr, relationObjectId,
+                                                        get_rel_name(relationObjectId),
+                                                        inhparent, current_hint, nested_level)));
                return;
+       }
 
        /* Find the parent for this relation */
        foreach (l, root->append_rel_list)
@@ -3045,6 +3220,16 @@ pg_hint_plan_get_relation_info(PlannerInfo *root, Oid relationObjectId,
                                           relationObjectId);
 
                /* Scan fixation status is the same to the parent. */
+               if (debug_level > 1)
+                       ereport(pg_hint_plan_message_level,
+                                       (errhidestmt(true),
+                                        errmsg("pg_hint_plan%s: get_relation_info:"
+                                                       " index deletion by parent hint: "
+                                                       "relation=%u(%s), inhparent=%d, current_hint=%p,"
+                                                       " nested_level=%d",
+                                                       qnostr, relationObjectId,
+                                                       get_rel_name(relationObjectId),
+                                                       inhparent, current_hint, nested_level)));
                return;
        }
 
@@ -3055,10 +3240,35 @@ pg_hint_plan_get_relation_info(PlannerInfo *root, Oid relationObjectId,
                hint->base.state = HINT_STATE_USED;
 
                delete_indexes(hint, rel, InvalidOid);
+
+               if (debug_level > 1)
+                       ereport(pg_hint_plan_message_level,
+                                       (errhidestmt(true),
+                                        errmsg ("pg_hint_plan%s: get_relation_info"
+                                                        " index deletion:"
+                                                        " relation=%u(%s), inhparent=%d, current_hint=%p,"
+                                                        " nested_level=%d, scanmask=0x%x",
+                                                        qnostr, relationObjectId,
+                                                        get_rel_name(relationObjectId),
+                                                        inhparent, current_hint, nested_level,
+                                                        hint->enforce_mask)));
        }
        else
+       {
+               if (debug_level > 1)
+                       ereport(pg_hint_plan_message_level,
+                                       (errhidestmt (true),
+                                        errmsg ("pg_hint_plan%s: get_relation_info"
+                                                        " no hint applied:"
+                                                        " relation=%u(%s), inhparent=%d, current_hint=%p,"
+                                                        " nested_level=%d, scanmask=0x%x",
+                                                        qnostr, relationObjectId,
+                                                        get_rel_name(relationObjectId),
+                                                        inhparent, current_hint, nested_level,
+                                                        current_hint->init_scan_mask)));
                set_scan_config_options(current_hint->init_scan_mask,
                                                                current_hint->context);
+       }
        return;
 }