@@ -7,13 +7,12 @@ PGDIR = $(root_dir)/tmp/postgres
77PGDIRBZ2 = $(root_dir ) /tmp/postgres.tar.bz2
88PGDIRZIP = $(root_dir ) /tmp/postgres.zip
99
10- PG_VERSION = 17.4
10+ PG_VERSION = 17.7
1111PG_VERSION_MAJOR = $(call word-dot,$(PG_VERSION ) ,1)
12- PG_VERSION_NUM = 170004
13- PG_BRANCH = REL_17_STABLE
12+ PG_VERSION_NUM = 170007
1413PROTOC_VERSION = 25.1
1514
16- VERSION = 6.1.0
15+ VERSION = 6.2.2
1716VERSION_MAJOR = $(call word-dot,$(VERSION ) ,1)
1817VERSION_MINOR = $(call word-dot,$(VERSION ) ,2)
1918VERSION_PATCH = $(call word-dot,$(VERSION ) ,3)
@@ -39,6 +38,7 @@ override CFLAGS += -g -I. -I./vendor -I./src/include -I./src/postgres/include -W
3938
4039ifeq ($(OS ) ,Windows_NT)
4140override CFLAGS += -I./src/postgres/include/port/win32
41+ override TEST_CFLAGS += -I./src/postgres/include/port/win32
4242endif
4343
4444override PG_CONFIGURE_FLAGS += -q --without-readline --without-zlib --without-icu
@@ -116,14 +116,9 @@ clean:
116116.PHONY : all clean build build_shared extract_source examples test install
117117
118118$(PGDIR ) :
119- # We temporarily build off REL_17_STABLE to pull in https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=6da2ba1d8a031984eb016fed6741bb2ac945f19d
120- # TODO: Go back to upstream tarball once 17.5 is released
121- # tar -xjf $(PGDIRBZ2)
122- # curl -o $(PGDIRBZ2) https://ftp.postgresql.org/pub/source/v$(PG_VERSION)/postgresql-$(PG_VERSION).tar.bz2
123- # mv $(root_dir)/postgresql-$(PG_VERSION) $(PGDIR)
124- curl -L -o $(PGDIRZIP) https://github.com/postgres/postgres/archive/refs/heads/$(PG_BRANCH).zip
125- unzip $(PGDIRZIP)
126- mv $(root_dir)/postgres-$(PG_BRANCH) $(PGDIR)
119+ curl -o $(PGDIRBZ2 ) https://ftp.postgresql.org/pub/source/v$(PG_VERSION ) /postgresql-$(PG_VERSION ) .tar.bz2
120+ tar -xjf $(PGDIRBZ2 )
121+ mv $(root_dir ) /postgresql-$(PG_VERSION ) $(PGDIR )
127122 cd $(PGDIR ) ; patch -p1 < $(root_dir ) /patches/01_parser_additional_param_ref_support.patch
128123 cd $(PGDIR ) ; patch -p1 < $(root_dir ) /patches/03_lexer_track_yyllocend.patch
129124 cd $(PGDIR ) ; patch -p1 < $(root_dir ) /patches/04_lexer_comments_as_tokens.patch
@@ -133,6 +128,7 @@ $(PGDIR):
133128 cd $(PGDIR ) ; patch -p1 < $(root_dir ) /patches/08_avoid_zero_length_delimiter_in_regression_tests.patch
134129 cd $(PGDIR ) ; patch -p1 < $(root_dir ) /patches/09_allow_param_junk.patch
135130 cd $(PGDIR ) ; patch -p1 < $(root_dir ) /patches/10_avoid_namespace_hashtab_impl_gen.patch
131+ cd $(PGDIR ) ; patch -p1 < $(root_dir ) /patches/11_ifndef_namedatalen.patch
136132 cd $(PGDIR ) ; ./configure $(PG_CONFIGURE_FLAGS )
137133 cd $(PGDIR ) ; make -C src/pl/plpgsql/src pl_gram.h plerrcodes.h pl_reserved_kwlist_d.h pl_unreserved_kwlist_d.h
138134 cd $(PGDIR ) ; make -C src/port pg_config_paths.h
@@ -241,14 +237,15 @@ examples/normalize_error: examples/normalize_error.c $(ARLIB)
241237examples/simple_plpgsql : examples/simple_plpgsql.c $(ARLIB )
242238 $(CC ) $(TEST_CFLAGS ) -o $@ -g examples/simple_plpgsql.c $(ARLIB ) $(TEST_LDFLAGS )
243239
244- TESTS = test/complex test/concurrency test/deparse test/fingerprint test/fingerprint_opts test/normalize test/normalize_utility test/parse test/parse_opts test/parse_protobuf test/parse_protobuf_opts test/parse_plpgsql test/scan test/split
240+ TESTS = test/complex test/concurrency test/deparse test/fingerprint test/fingerprint_opts test/is_utility_stmt test/ normalize test/normalize_utility test/parse test/parse_opts test/parse_protobuf test/parse_protobuf_opts test/parse_plpgsql test/scan test/split test/summary test/summary_truncate
245241test : $(TESTS )
246242ifeq ($(VALGRIND ) ,1)
247243 $(VALGRIND_MEMCHECK) test/complex || (cat test/valgrind.log && false)
248244 $(VALGRIND_MEMCHECK) test/concurrency || (cat test/valgrind.log && false)
249245 $(VALGRIND_MEMCHECK) test/deparse || (cat test/valgrind.log && false)
250246 $(VALGRIND_MEMCHECK) test/fingerprint || (cat test/valgrind.log && false)
251247 $(VALGRIND_MEMCHECK) test/fingerprint_opts || (cat test/valgrind.log && false)
248+ $(VALGRIND_MEMCHECK) test/is_utility_stmt || (cat test/valgrind.log && false)
252249 $(VALGRIND_MEMCHECK) test/normalize || (cat test/valgrind.log && false)
253250 $(VALGRIND_MEMCHECK) test/normalize_utility || (cat test/valgrind.log && false)
254251 $(VALGRIND_MEMCHECK) test/parse || (cat test/valgrind.log && false)
@@ -257,6 +254,8 @@ ifeq ($(VALGRIND),1)
257254 $(VALGRIND_MEMCHECK) test/parse_protobuf_opts || (cat test/valgrind.log && false)
258255 $(VALGRIND_MEMCHECK) test/scan || (cat test/valgrind.log && false)
259256 $(VALGRIND_MEMCHECK) test/split || (cat test/valgrind.log && false)
257+ $(VALGRIND_MEMCHECK) test/summary || (cat test/valgrind.log && false)
258+ $(VALGRIND_MEMCHECK) test/summary_truncate || (cat test/valgrind.log && false)
260259 # Output-based tests
261260 $(VALGRIND_MEMCHECK) test/parse_plpgsql || (cat test/valgrind.log && false)
262261 diff -Naur test/plpgsql_samples.expected.json test/plpgsql_samples.actual.json
266265 test/deparse
267266 test/fingerprint
268267 test/fingerprint_opts
268+ test/is_utility_stmt
269269 test/normalize
270270 test/normalize_utility
271271 test/parse
274274 test/parse_protobuf_opts
275275 test/scan
276276 test/split
277+ test/summary
278+ test/summary_truncate
277279 # Output-based tests
278280 test/parse_plpgsql
279281 diff -Naur test/plpgsql_samples.expected.json test/plpgsql_samples.actual.json
@@ -297,6 +299,10 @@ test/fingerprint_opts: test/fingerprint_opts.c test/fingerprint_opts_tests.c $(A
297299 # We have "-Isrc/" because this test uses pg_query_fingerprint_with_opts
298300 $(CC ) $(TEST_CFLAGS ) -o $@ -Isrc/ test/fingerprint_opts.c $(ARLIB ) $(TEST_LDFLAGS )
299301
302+ test/is_utility_stmt : test/framework/main.c test/is_utility_stmt.c $(ARLIB )
303+ # We have "-Isrc/postgres/include" because this test uses pg_query_summary_direct
304+ $(CC ) $(TEST_CFLAGS ) -o $@ -Isrc/postgres/include test/framework/main.c test/is_utility_stmt.c $(ARLIB ) $(TEST_LDFLAGS )
305+
300306test/normalize : test/normalize.c test/normalize_tests.c $(ARLIB )
301307 $(CC ) $(TEST_CFLAGS ) -o $@ test/normalize.c $(ARLIB ) $(TEST_LDFLAGS )
302308
@@ -306,6 +312,14 @@ test/normalize_utility: test/normalize_utility.c test/normalize_utility_tests.c
306312test/parse : test/parse.c test/parse_tests.c $(ARLIB )
307313 $(CC ) $(TEST_CFLAGS ) -o $@ test/parse.c $(ARLIB ) $(TEST_LDFLAGS )
308314
315+ test/summary : test/framework/main.c test/summary.c test/summary_tests.c test/summary_tests_list.c $(ARLIB )
316+ # We have "-Isrc/postgres/include" because this test uses pg_query_summary_direct
317+ $(CC ) $(TEST_CFLAGS ) -o $@ -Isrc/postgres/include test/framework/main.c test/summary.c $(ARLIB ) $(TEST_LDFLAGS )
318+
319+ test/summary_truncate : test/framework/main.c test/summary_truncate.c $(ARLIB )
320+ # We have "-Isrc/postgres/include" because this test uses pg_query_summary_direct
321+ $(CC ) $(TEST_CFLAGS ) -o $@ -Isrc/postgres/include test/framework/main.c test/summary_truncate.c $(ARLIB ) $(TEST_LDFLAGS )
322+
309323test/parse_opts : test/parse_opts.c test/parse_opts_tests.c $(ARLIB )
310324 $(CC ) $(TEST_CFLAGS ) -o $@ test/parse_opts.c $(ARLIB ) $(TEST_LDFLAGS )
311325
@@ -336,4 +350,5 @@ install: $(ARLIB) $(SOLIB)
336350 $(LN_S ) $(SOLIBVER ) " $( DESTDIR) " $(libdir ) /$(SOLIB )
337351 $(INSTALL ) -d " $( DESTDIR) " $(includedir ) /$(TARGET )
338352 $(INSTALL ) -m 644 pg_query.h " $( DESTDIR) " $(includedir ) /pg_query.h
353+ $(INSTALL ) -m 644 postgres_deparse.h " $( DESTDIR) " $(includedir ) /postgres_deparse.h
339354 $(INSTALL ) -m 644 protobuf/pg_query.proto " $( DESTDIR) " $(includedir ) /$(TARGET ) /pg_query.proto
0 commit comments