laurenz / oracle_fdw

PostgreSQL Foreign Data Wrapper for Oracle
http://laurenz.github.io/oracle_fdw/
Other
469 stars 153 forks source link

make command raise error while installing oracle_fdw #649

Closed MobeenNaser closed 4 months ago

MobeenNaser commented 4 months ago

while I'm trying to install oracle_fdw this error raised :

Makefile:30: /usr/pgsql-15/lib/pgxs/src/makefiles/pgxs.mk: No such file or directory make: *** No rule to make target '/usr/pgsql-15/lib/pgxs/src/makefiles/pgxs.mk'. Stop.

laurenz commented 4 months ago

This is a duplicate of #390 and #615. Please install the "devel" RPM.

MobeenNaser commented 4 months ago

i have installed all *-devel Packages but noting changed

laurenz commented 4 months ago

Perhaps you installed the wrong one. What do you get for

rpm -q -a postgres\*
MobeenNaser commented 4 months ago

postgresql12-plperl-12.18-1PGDG.rhel8.x86_64 postgresql16-plperl-16.2-1PGDG.rhel8.x86_64 postgresql12-12.18-1PGDG.rhel8.x86_64 postgresql14-server-14.11-1PGDG.rhel8.x86_64 postgresql16-libs-16.2-1PGDG.rhel8.x86_64 postgresql16-16.2-1PGDG.rhel8.x86_64 postgresql12-libs-12.18-1PGDG.rhel8.x86_64 postgresql13-server-13.14-1PGDG.rhel8.x86_64 postgresql15-libs-15.6-1PGDG.rhel8.x86_64 postgresql14-14.11-1PGDG.rhel8.x86_64 postgresql15-15.6-1PGDG.rhel8.x86_64 postgresql14-plperl-14.11-1PGDG.rhel8.x86_64 postgresql15-plperl-15.6-1PGDG.rhel8.x86_64 postgresql14-libs-14.11-1PGDG.rhel8.x86_64 postgresql12-server-12.18-1PGDG.rhel8.x86_64 postgresql13-13.14-1PGDG.rhel8.x86_64 postgresql16-server-16.2-1PGDG.rhel8.x86_64 postgresql13-libs-13.14-1PGDG.rhel8.x86_64 postgresql13-plperl-13.14-1PGDG.rhel8.x86_64 postgresql15-server-15.6-1PGDG.rhel8.x86_64

laurenz commented 4 months ago

No, you didn't install postgresql15-devel.

MobeenNaser commented 4 months ago

where can i find it

laurenz commented 4 months ago

Where you found the other packages. How did you install PostgreSQL?

MobeenNaser commented 4 months ago

i followed the website instructions

Install the repository RPM:

sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm

Disable the built-in PostgreSQL module:

sudo dnf -qy module disable postgresql

Install PostgreSQL:

sudo dnf install -y postgresql15-server

Optionally initialize the database and enable automatic start:

sudo /usr/pgsql-15/bin/postgresql-15-setup initdb sudo systemctl enable postgresql-15 sudo systemctl start postgresql-15

laurenz commented 4 months ago

Well, there you have the answer:

sudo dnf install postgresql15-devel

Unrelated, but you should always install the "contrib" package as well.

MobeenNaser commented 4 months ago

i have installed it and i run make command but while running make install this is the output:

make install /usr/bin/mkdir -p '/usr/pgsql-15/lib' /usr/bin/mkdir -p '/usr/pgsql-15/share/extension' /usr/bin/mkdir -p '/usr/pgsql-15/share/extension' /usr/bin/mkdir -p '/usr/pgsql-15/doc/extension' /usr/bin/install -c -m 755 oracle_fdw.so '/usr/pgsql-15/lib/oracle_fdw.so' /usr/bin/install: cannot create regular file '/usr/pgsql-15/lib/oracle_fdw.so': Permission denied make: *** [/usr/pgsql-15/lib/pgxs/src/makefiles/../../src/Makefile.shlib:461: install-lib-shared] Error 1

i run make install using postgres OS user

laurenz commented 4 months ago

Please read the documentation (which would have covered all your other questions as well):

For the second step you need write permission on the directories where PostgreSQL is installed.

You will have to run make install as root.

MobeenNaser commented 4 months ago

i run it as root

but i'm facing this error while creating the extension

create extension oracle_fdw; ERROR: could not load library "/usr/pgsql-15/lib/oracle_fdw.so": libclntsh.so.12.1: cannot open shared object file: No such file or directory

laurenz commented 4 months ago

Ok. Read the documentation. All that is described there. Or read the dozens of issues people created about this. Why do you want me to spoon-feed you every single step?

laurenz commented 4 months ago

In particular, #22 and #440 might help you. You have to make sure that the directory with the shared library is on the library path of PostgreSQL.

laurenz commented 4 months ago

Sorry for my annoyance; I know you're not doing it on purpose.

I assume that you are starting PostgreSQL via systemd. Assuming that the path where libclntsh.so.12 is is /path/to/oracle, you'd proceed as follows:

MobeenNaser commented 4 months ago

it's okay i will try and send you the results

MobeenNaser commented 4 months ago

it's not working , can you please tell me how can i down load postgresql 15.6 i just can find 15.1 on website

laurenz commented 4 months ago

You already downloaded and installed PostgreSQL 15.6, as your output above shows. Why download it again?

You did replace /path/to/oracle with the actual path on your system, right?

MobeenNaser commented 4 months ago

no it's 15.1

postgres=# select version(); version

PostgreSQL 15.1 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-15), 64-bit (1 row)

laurenz commented 4 months ago

Did you lie when you posted the list of installed RPMs?

MobeenNaser commented 4 months ago

no why should i lie ?

laurenz commented 4 months ago

Then why does it say 15.6 there?

MobeenNaser commented 4 months ago

i dont know

laurenz commented 4 months ago

Sorry, I don't think I can help you. Perhaps you can ask somebody who understands a little bit about computers to have a look at your system and assist you.