Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add postgres version check in makefile #605

Merged
merged 4 commits into from
Feb 14, 2025

Conversation

AndrewJackson2020
Copy link
Contributor

This PR adds a version check to the makefile. I know the versions are specified in the docs but is a bit more user friendly to have the build failed with an error message.

Behavior with this patch

$ PATH=/path/to/postgres/18/bin:$PATH make
Makefile.global:11: *** maximum version of PostgreSQL required is 17 (but have 18).  Stop.

Behavior without this patch

$ PATH=path/to/pg18/bin:$PATH make
g++ -Wall -Wpointer-arith -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -O2 -std=c++17  -Wno-sign-compare -Wshadow -Wswitch -Wunused-parameter -Wunreachable-code -Wno-unknown-pragmas -Wall -Wextra  -Wno-register -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Iinclude -isystem third_party/duckdb/src/include -isystem third_party/duckdb/third_party/re2 -isystem path/to/pg18/include/server -Wno-sign-compare -Wshadow -Wswitch -Wunused-parameter -Wunreachable-code -Wno-unknown-pragmas -Wall -Wextra  -I. -I./ -Ipath/to/pg18/include/server -Ipath/to/pg18/include/internal  -D_GNU_SOURCE   -c -o src/pgduckdb_background_worker.o src/pgduckdb_background_worker.cpp -MMD -MP -MF .deps/pgduckdb_background_worker.Po
g++ -Wall -Wpointer-arith -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -O2 -std=c++17  -Wno-sign-compare -Wshadow -Wswitch -Wunused-parameter -Wunreachable-code -Wno-unknown-pragmas -Wall -Wextra  -Wno-register -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Iinclude -isystem third_party/duckdb/src/include -isystem third_party/duckdb/third_party/re2 -isystem path/to/pg18/include/server -Wno-sign-compare -Wshadow -Wswitch -Wunused-parameter -Wunreachable-code -Wno-unknown-pragmas -Wall -Wextra  -I. -I./ -Ipath/to/pg18/include/server -Ipath/to/pg18/include/internal  -D_GNU_SOURCE   -c -o src/pgduckdb.o src/pgduckdb.cpp -MMD -MP -MF .deps/pgduckdb.Po
g++ -Wall -Wpointer-arith -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -O2 -std=c++17  -Wno-sign-compare -Wshadow -Wswitch -Wunused-parameter -Wunreachable-code -Wno-unknown-pragmas -Wall -Wextra  -Wno-register -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Iinclude -isystem third_party/duckdb/src/include -isystem third_party/duckdb/third_party/re2 -isystem path/to/pg18/include/server -Wno-sign-compare -Wshadow -Wswitch -Wunused-parameter -Wunreachable-code -Wno-unknown-pragmas -Wall -Wextra  -I. -I./ -Ipath/to/pg18/include/server -Ipath/to/pg18/include/internal  -D_GNU_SOURCE   -c -o src/pgduckdb_ddl.o src/pgduckdb_ddl.cpp -MMD -MP -MF .deps/pgduckdb_ddl.Po
src/pgduckdb_ddl.cpp: In function ‘void DuckdbHandleDDL(PlannedStmt*, const char*, ParamListInfo)’:
src/pgduckdb_ddl.cpp:186:49: error: cannot convert ‘Node*’ to ‘Query*in assignment
  186 |                         stmt->into->viewQuery = (Node *)copyObjectImpl(stmt->query);
      |                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                 |
      |                                                 Node*
make: *** [Makefile.global:38: src/pgduckdb_ddl.o] Error 1

@JelteF JelteF enabled auto-merge (squash) February 14, 2025 16:08
@JelteF JelteF merged commit b4c552d into duckdb:main Feb 14, 2025
5 checks passed
@AndrewJackson2020 AndrewJackson2020 deleted the postgres_version_check branch February 14, 2025 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants