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

Unable to make #85

Closed
mbwmbw1337 opened this issue Sep 20, 2023 · 9 comments
Closed

Unable to make #85

mbwmbw1337 opened this issue Sep 20, 2023 · 9 comments

Comments

@mbwmbw1337
Copy link
Contributor

I have postgres 15 and 16 installed.

Seeing this result

postgres@dal-edge-3:~/sqlite_fdw$ /usr/bin/gmake USE_PGXS=1
Makefile:41: *** PostgreSQL 11, 12, 13, 14 or 15 is required to compile this extension.  Stop.
postgres@dal-edge-3:~/sqlite_fdw$ make USE_PGXS=1
Makefile:41: *** PostgreSQL 11, 12, 13, 14 or 15 is required to compile this extension.  Stop.
@t-kataym
Copy link
Contributor

We are in progress to support postgres 16 as #84.

@mbwmbw1337
Copy link
Contributor Author

Shouldn't I still be able to build for Postgres 15 or do I need to uninstall Postgres 16 for that to work?

@mbwmbw1337
Copy link
Contributor Author

mbwmbw1337 commented Sep 21, 2023

Anyone else having this issue where you want to build FDW for a lower version but pg_config is defaulting to the highest version do as follows to prepend the version you wish to compile for
PATH=/usr/lib/postgresql/15/bin:/etc/postgresql/15/main:$PATH USE_PGXS=1 make
PATH=/usr/lib/postgresql/15/bin:/etc/postgresql/15/main:$PATH USE_PGXS=1 make install

@mbwmbw1337
Copy link
Contributor Author

@t-kataym you may want to add this as a workaround as the makefile uses the pg_config to check the version regardless of the /etc/postgresql path. Therefore you need to prepend the bin path of the version you are targeting so the makefile knows you're building for a supported version.

@mkgrgis
Copy link
Contributor

mkgrgis commented Sep 25, 2023

Shouldn't I still be able to build for Postgres 15 or do I need to uninstall Postgres 16 for that to work?

You can build for not one PostgreSQL version if you have PostgreSQL source code trees where sqlite_fdw was copied to contrib as sqlite_fdw.

In case of USE_PGXS=1 in OS environment default version is the highest, but you can change this behaviour of make process in a standard way.

@mbwmbw1337
Copy link
Contributor Author

The instructions though, only say to prepend the postgres home/config path, not the BIN path.

The solution is to prepend BOTH the bin and home/config path. I will create a pull request to update the docs as the makefile relies on pg_config which sits in the postgres bin path.

For instance this worked:
PATH=/usr/lib/postgresql/15/bin:/etc/postgresql/15/main:$PATH USE_PGXS=1 make
PATH=/usr/lib/postgresql/15/bin:/etc/postgresql/15/main:$PATH USE_PGXS=1 make install

@t-kataym
Copy link
Contributor

If you installed 2 versions of PostgreSQL (15 and 16), 2 pg_config are also installed.
When you executing pg_config command, if pg_config for 16 is used, sqlite_fdw will be built for 16. Vice versa.
It depends on the priority of path resolution.

@t-kataym
Copy link
Contributor

We have just released new sqlite_fdw supporting PostgreSQL16.0.

@mbwmbw1337
Copy link
Contributor Author

I confirmed this works and tested it. Thank you.

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

No branches or pull requests

3 participants