OSDN Git Service

Support PG12.
authorKyotaro Horiguchi <horikyota.ntt@gmail.com>
Thu, 20 Feb 2020 11:53:24 +0000 (20:53 +0900)
committerKyotaro Horiguchi <horikyota.ntt@gmail.com>
Thu, 20 Feb 2020 11:53:24 +0000 (20:53 +0900)
As the prepparation for making PG12 branch, change PG version to 12
and adjust for the latest PG12.

Makefile
SPECS/pg_hint_plan12.spec [moved from SPECS/pg_hint_plan11.spec with 82% similarity]
expected/ut-J.out
expected/ut-S.out
expected/ut-W.out

index f817acf..5d9f65a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -22,8 +22,8 @@ PG_CONFIG = pg_config
 PGXS := $(shell $(PG_CONFIG) --pgxs)
 include $(PGXS)
 
-STARBALL11 = pg_hint_plan11-$(HINTPLANVER).tar.gz
-STARBALLS = $(STARBALL11)
+STARBALL12 = pg_hint_plan12-$(HINTPLANVER).tar.gz
+STARBALLS = $(STARBALL12)
 
 TARSOURCES = Makefile *.c  *.h COPYRIGHT* \
        pg_hint_plan--*.sql \
@@ -37,7 +37,7 @@ endif
 
 installcheck: $(REGRESSION_EXPECTED)
 
-rpms: rpm11
+rpms: rpm12
 
 # pg_hint_plan.c includes core.c and make_join_rel.c
 pg_hint_plan.o: core.c make_join_rel.c # pg_stat_statements.c
@@ -52,7 +52,7 @@ $(STARBALLS): $(TARSOURCES)
        tar -chzf $@ $(addprefix $(subst .tar.gz,,$@)/, $^)
        rm $(subst .tar.gz,,$@)
 
-rpm11: $(STARBALL11)
-       MAKE_ROOT=`pwd` rpmbuild -bb SPECS/pg_hint_plan11.spec
+rpm12: $(STARBALL12)
+       MAKE_ROOT=`pwd` rpmbuild -bb SPECS/pg_hint_plan12.spec
 
 
similarity index 82%
rename from SPECS/pg_hint_plan11.spec
rename to SPECS/pg_hint_plan12.spec
index 06c73f4..e81fbbd 100644 (file)
@@ -1,7 +1,7 @@
 # SPEC file for pg_store_plans
 # Copyright(C) 2020 NIPPON TELEGRAPH AND TELEPHONE CORPORATION
 
-%define _pgdir   /usr/pgsql-11
+%define _pgdir   /usr/pgsql-12
 %define _bindir  %{_pgdir}/bin
 %define _libdir  %{_pgdir}/lib
 %define _datadir %{_pgdir}/share
@@ -14,8 +14,8 @@
 %endif
 
 ## Set general information for pg_store_plans.
-Summary:    Optimizer hint on PostgreSQL 11
-Name:       pg_hint_plan11
+Summary:    Optimizer hint on PostgreSQL 12
+Name:       pg_hint_plan12
 Version:    1.3.4
 Release:    1%{?dist}
 License:    BSD
@@ -26,8 +26,8 @@ BuildRoot:  %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u} -n)
 Vendor:     NIPPON TELEGRAPH AND TELEPHONE CORPORATION
 
 ## We use postgresql-devel package
-BuildRequires:  postgresql11-devel
-Requires:  postgresql11-server
+BuildRequires:  postgresql12-devel
+Requires:  postgresql12-server
 
 ## Description for "pg_hint_plan"
 %description
@@ -35,19 +35,19 @@ Requires:  postgresql11-server
 pg_hint_plan provides capability to tweak execution plans to be
 executed on PostgreSQL.
 
-Note that this package is available for only PostgreSQL 11.
+Note that this package is available for only PostgreSQL 12.
 
 %package llvmjit
-Requires: postgresql11-server, postgresql11-llvmjit
-Requires: pg_hint_plan11 = 1.3.4
-Summary:  Just-in-time compilation support for pg_hint_plan11
+Requires: postgresql12-server, postgresql12-llvmjit
+Requires: pg_hint_plan12 = 1.3.4
+Summary:  Just-in-time compilation support for pg_hint_plan12
 
 %description llvmjit
-Just-in-time compilation support for pg_hint_plan11
+Just-in-time compilation support for pg_hint_plan12
 
 ## pre work for build pg_hint_plan
 %prep
-PATH=/usr/pgsql-11/bin:$PATH
+PATH=/usr/pgsql-12/bin:$PATH
 if [ "${MAKE_ROOT}" != "" ]; then
   pushd ${MAKE_ROOT}
   make clean %{name}-%{version}.tar.gz
@@ -58,7 +58,7 @@ if [ ! -d %{_rpmdir} ]; then mkdir -p %{_rpmdir}; fi
 
 ## Set variables for build environment
 %build
-PATH=/usr/pgsql-11/bin:$PATH
+PATH=/usr/pgsql-12/bin:$PATH
 make USE_PGXS=1 %{?_smp_mflags}
 
 ## Set variables for install
index 48f6345..b54be5b 100644 (file)
@@ -4708,8 +4708,8 @@ error hint:
 
 \o
 \! sql/maskout.sh results/ut-J.tmpout
-                                QUERY PLAN                                
---------------------------------------------------------------------------
+                                  QUERY PLAN                                   
+-------------------------------------------------------------------------------
  Hash Full Join  (cost={inf}..{inf} rows=1000 width=xxx)
    Hash Cond: (t1.c1 = t2.c1)
    ->  Seq Scan on t1  (cost=xxx..xxx rows=1000 width=xxx)
index 442a606..1780b46 100644 (file)
@@ -3761,8 +3761,9 @@ error hint:
  c4     | text    |           |          | 
 Indexes:
     "ti1_pkey" PRIMARY KEY, btree (c1)
-    "ti1_btree" btree (c1)
     "ti1_c2_key" UNIQUE CONSTRAINT, btree (c2)
+    "ti1_uniq" UNIQUE, btree (c1)
+    "ti1_btree" btree (c1)
     "ti1_expr" btree ((c1 < 100))
     "ti1_gin" gin (c1)
     "ti1_gist" gist (c1)
@@ -3774,7 +3775,6 @@ Indexes:
     "ti1_multi" btree (c1, c2, c3, c4)
     "ti1_pred" btree (lower(c4))
     "ti1_ts" gin (to_tsvector('english'::regconfig, c4))
-    "ti1_uniq" UNIQUE, btree (c1)
 
 EXPLAIN (COSTS false) SELECT * FROM s1.ti1 WHERE c1 < 100 AND c2 = 1 AND lower(c4) = '1' AND to_tsvector('english', c4) @@ 'a & b' AND ctid = '(1,1)';
                                                                QUERY PLAN                                                                
@@ -4487,8 +4487,8 @@ error hint:
 
 \o
 \! sql/maskout.sh results/ut-S.tmpout
-                               QUERY PLAN                               
-------------------------------------------------------------------------
+                                  QUERY PLAN                                   
+-------------------------------------------------------------------------------
  Seq Scan on ti1  (cost={inf}..{inf} rows=1 width=xxx)
    Filter: (c1 = 100)
 
@@ -4505,8 +4505,8 @@ error hint:
 
 \o
 \! sql/maskout.sh results/ut-S.tmpout
-                               QUERY PLAN                               
-------------------------------------------------------------------------
+                                  QUERY PLAN                                   
+-------------------------------------------------------------------------------
  Seq Scan on ti1  (cost={inf}..{inf} rows=1 width=xxx)
    Filter: (c1 = 100)
 
@@ -4523,8 +4523,8 @@ error hint:
 
 \o
 \! sql/maskout.sh results/ut-S.tmpout
-                              QUERY PLAN                               
------------------------------------------------------------------------
+                                  QUERY PLAN                                   
+-------------------------------------------------------------------------------
  Seq Scan on ti1  (cost={inf}..{inf} rows=1 width=xxx)
    Filter: (c1 = 100)
 
@@ -4541,8 +4541,8 @@ error hint:
 
 \o
 \! sql/maskout.sh results/ut-S.tmpout
-                               QUERY PLAN                               
-------------------------------------------------------------------------
+                                  QUERY PLAN                                   
+-------------------------------------------------------------------------------
  Seq Scan on ti1  (cost={inf}..{inf} rows=1 width=xxx)
    Filter: (c1 = 100)
 
@@ -4559,8 +4559,8 @@ error hint:
 
 \o
 \! sql/maskout.sh results/ut-S.tmpout
-                               QUERY PLAN                               
-------------------------------------------------------------------------
+                                  QUERY PLAN                                   
+-------------------------------------------------------------------------------
  Seq Scan on ti1  (cost={inf}..{inf} rows=1 width=xxx)
    Filter: (c1 = 100)
 
@@ -4577,8 +4577,8 @@ error hint:
 
 \o
 \! sql/maskout.sh results/ut-S.tmpout
-                              QUERY PLAN                               
------------------------------------------------------------------------
+                                  QUERY PLAN                                   
+-------------------------------------------------------------------------------
  Seq Scan on ti1  (cost={inf}..{inf} rows=1 width=xxx)
    Filter: (c1 = 100)
 
@@ -4601,8 +4601,8 @@ error hint:
 
 \o
 \! sql/maskout.sh results/ut-S.tmpout
-                              QUERY PLAN                               
------------------------------------------------------------------------
+                                  QUERY PLAN                                   
+-------------------------------------------------------------------------------
  Seq Scan on t1  (cost={inf}..{inf} rows=1 width=xxx)
    Filter: (c1 = 1)
 
@@ -5277,8 +5277,8 @@ error hint:
 
 \o
 \! sql/maskout.sh results/ut-S.tmpout
-                                  QUERY PLAN                                  
-------------------------------------------------------------------------------
+                                  QUERY PLAN                                   
+-------------------------------------------------------------------------------
  Append  (cost=xxx..xxx rows=4 width=xxx)
    ->  Index Scan using p1_i2 on p1  (cost=xxx..xxx rows=1 width=xxx)
          Index Cond: (c2 = 1)
index f12ace1..72057e5 100644 (file)
@@ -1241,7 +1241,7 @@ error hint:
 
 \o
 \! sql/maskout2.sh results/ut-W.tmpout
-                                            QUERY PLAN                                             
+                                                QUERY PLAN                                                 
 --(snip..)
  Append
    ->  Result