Skip to content

Commit 085f236

Browse files
committed
Fix build errors and tests with our standard and enterprise versions
1 parent 497ab20 commit 085f236

File tree

8 files changed

+32
-21
lines changed

8 files changed

+32
-21
lines changed

Makefile

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,13 @@
22

33
MODULE_big = pg_pathman
44

5-
ifdef USE_PGXS
6-
PG_CONFIG = pg_config
7-
VNUM := $(shell $(PG_CONFIG) --version | awk '{print $$2}')
8-
ifeq ($(VNUM),$(filter 10% 11%,$(VNUM)))
9-
EXTRA_REGRESS = pathman_declarative
10-
EXTRA_OBJS = src/declarative.o
11-
endif
12-
endif
13-
include $(PGXS)
14-
155
OBJS = src/init.o src/relation_info.o src/utils.o src/partition_filter.o \
166
src/runtime_append.o src/runtime_merge_append.o src/pg_pathman.o src/rangeset.o \
177
src/pl_funcs.o src/pl_range_funcs.o src/pl_hash_funcs.o src/pathman_workers.o \
188
src/hooks.o src/nodes_common.o src/xact_handling.o src/utility_stmt_hooking.o \
199
src/planner_tree_modification.o src/debug_print.o src/partition_creation.o \
2010
src/compat/pg_compat.o src/compat/rowmarks_fix.o src/partition_router.o \
21-
src/partition_overseer.o $(EXTRA_OBJS) $(WIN32RES)
11+
src/partition_overseer.o $(WIN32RES)
2212

2313
ifdef USE_PGXS
2414
override PG_CPPFLAGS += -I$(CURDIR)/src/include
@@ -70,24 +60,45 @@ REGRESS = pathman_array_qual \
7060
pathman_update_triggers \
7161
pathman_upd_del \
7262
pathman_utility_stmt \
73-
pathman_views $(EXTRA_REGRESS)
63+
pathman_views
7464

7565

7666
EXTRA_REGRESS_OPTS=--temp-config=$(top_srcdir)/$(subdir)/conf.add
7767

7868
EXTRA_CLEAN = pg_pathman--$(EXTVERSION).sql ./isolation_output
7969

8070
ifdef USE_PGXS
81-
PG_CONFIG = pg_config
71+
PG_CONFIG=pg_config
8272
PGXS := $(shell $(PG_CONFIG) --pgxs)
83-
include $(PGXS)
73+
VNUM := $(shell $(PG_CONFIG) --version | awk '{print $$2}')
8474
else
8575
subdir = contrib/pg_pathman
8676
top_builddir = ../..
8777
include $(top_builddir)/src/Makefile.global
78+
endif
79+
80+
# our standard version could also use declarative syntax
81+
ifdef PGPRO_EDITION
82+
ifeq ($(PGPRO_EDITION),standard)
83+
VNUM := $(VERSION)
84+
endif
85+
endif
86+
87+
ifdef VNUM
88+
ifeq ($(VNUM),$(filter 10% 11%,$(VNUM)))
89+
REGRESS += pathman_declarative
90+
OBJS += src/declarative.o
91+
override PG_CPPFLAGS += -DENABLE_DECLARATIVE
92+
endif
93+
endif
94+
95+
ifdef USE_PGXS
96+
include $(PGXS)
97+
else
8898
include $(top_srcdir)/contrib/contrib-global.mk
8999
endif
90100

101+
91102
$(EXTENSION)--$(EXTVERSION).sql: init.sql hash.sql range.sql
92103
cat $^ > $@
93104

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The `pg_pathman` module provides optimized partitioning mechanism and functions
1010
The extension is compatible with:
1111

1212
* PostgreSQL 9.5, 9.6, 10, 11;
13-
* Postgres Pro Standard 9.5, 9.6;
13+
* Postgres Pro Standard 9.5, 9.6, 10;
1414
* Postgres Pro Enterprise;
1515

1616
Take a look at our Wiki [out there](https://github.com/postgrespro/pg_pathman/wiki).

sql/pathman_hashjoin.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ SET enable_seqscan = OFF;
3333
SET enable_nestloop = OFF;
3434
SET enable_hashjoin = ON;
3535
SET enable_mergejoin = OFF;
36+
3637
EXPLAIN (COSTS OFF)
3738
SELECT * FROM test.range_rel j1
3839
JOIN test.range_rel j2 on j2.id = j1.id

sql/pathman_mergejoin.sql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ WHERE j1.dt < '2015-03-01' AND j2.dt >= '2015-02-01' ORDER BY j2.dt;
4444
SET enable_hashjoin = ON;
4545
SET enable_nestloop = ON;
4646

47-
4847
DROP SCHEMA test CASCADE;
4948
DROP EXTENSION pg_pathman;
5049
DROP SCHEMA pathman CASCADE;

src/declarative.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* we set it back (look `is_pathman_related_partitioning_cmd`)
3030
*/
3131
void
32-
modify_declative_partitioning_query(Query *query)
32+
modify_declarative_partitioning_query(Query *query)
3333
{
3434
if (query->commandType != CMD_UTILITY)
3535
return;

src/hooks.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,7 @@ pathman_process_utility_hook(Node *first_arg,
962962
get_attname_compat(relation_oid, attr_number),
963963
get_rel_name(relation_oid))));
964964
}
965-
#if PG_VERSION_NUM >= 100000
965+
#ifdef ENABLE_DECLARATIVE
966966
else if (is_pathman_related_partitioning_cmd(parsetree, &relation_oid))
967967
{
968968
/* we can handle all the partitioning commands in ALTER .. TABLE */

src/include/declarative.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include "nodes/nodes.h"
66
#include "nodes/parsenodes.h"
77

8-
void modify_declative_partitioning_query(Query *query);
8+
void modify_declarative_partitioning_query(Query *query);
99
bool is_pathman_related_partitioning_cmd(Node *parsetree, Oid *parent_relid);
1010

1111
/* actual actions */

src/planner_tree_modification.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,8 @@ pathman_post_analyze_query_walker(Node *node, void *context)
429429
Query *query = (Query *) node;
430430

431431
/* Make changes for declarative syntax */
432-
#if PG_VERSION_NUM >= 100000
433-
modify_declative_partitioning_query(query);
432+
#ifdef ENABLE_DECLARATIVE
433+
modify_declarative_partitioning_query(query);
434434
#endif
435435

436436
/* Handle Query node */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy