LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   cannot "make USE_PGXS=1" b/c no pgxs.mk exists (https://www.linuxquestions.org/questions/linux-newbie-8/cannot-make-use_pgxs%3D1-b-c-no-pgxs-mk-exists-891127/)

jonathansfl 07-11-2011 12:04 PM

cannot "make USE_PGXS=1" b/c no pgxs.mk exists
 
Greetings
I'm using Ubuntu 10.04 LTS Server and Postgresql 8.4.8.

I'm trying to set up Cybertec's ODBC_LINK program (http://www.cybertec.at/download/odbc..._odbc_link.pdf )
so I can read MS-SQL data into my Postgresql 8.4.8 database.

Their build instructions say to Compile the module using make USE_PGXS=1.
Code:

sudo make USE_PGXS=1
sudo make install USE_PGXS=1

When I run that I get:

Quote:

postgres@dev-postgres-1:~/ODBC-Link-1.0.4$ make USE_PGXS=1
Makefile:12: /usr/lib/postgresql/8.4/lib/pgxs/src/makefiles/pgxs.mk: No such file or directory
make: *** No rule to make target `/usr/lib/postgresql/8.4/lib/pgxs/src/makefiles/pgxs.mk'. Stop.
postgres@dev-postgres-1:~/ODBC-Link-1.0.4$
I had to manually install the libpq-dev library (which informed that it replaces postgresql-dev library) and I manually created a folder for ' /usr/lib/postgresql/8.4/lib/pgxs/src/makefiles/" but I don't have a pgxs.mk file to paste into that "makefiles" folder. But apparently that installation did not install the files including /usr/lib/postgresql/8.4/lib/pgxs/src/makefiles/pgxs.mk

Why are the PGXS files / folders not automatically created for me? How can i install PGXS so that the make process succeeds?

If someone knows an easier way to read directly from a MS-SQL table or view into a Postgres function I'd love to know about it! I don't want to use MSSQL DTS as i don't have control of that server, so i can't use .csv intermediary files or that kind of strategy (i can only access 2 read-only views on their server). I'm trying to
Code:

INSERT INTO postgres_table (pg fields...) SELECT * FROM ODBCSOURCE;
I want to read from that ODBC stream directly in Postgresql, like a SELECT on Linked Servers in MSSQL-world or on a linked table in MSACCESS. That would give control over the ODBC interaction to the PG function rather than a non-DB entity.

Help!

baxzius 07-11-2011 12:39 PM

i hope this will be useful
http://postgresql.1045698.n5.nabble....td4551314.html

jonathansfl 07-11-2011 01:21 PM

thanks, no, that is my post in the postgresql world trying to get answers to how to import data directly to Postgres from an ODBC link. Now I'm just trying to get PGXS working so I can attempt to install the ODBC-Link program.

Apparently I need to "set the PGXS environment variable" or "copy it into the contrib directory of your source code and compile it like a contrib module".
I tried
Quote:

export PATH=:/usr/bin/pg_config
but that didn't help.

Quote:

postgres@dev-postgres-1:~/ODBC-Link-1.0.4$ whereis pg_config
pg_config: /usr/bin/pg_config /usr/share/man/man1/pg_config.1.gz
postgres@dev-postgres-1:~/ODBC-Link-1.0.4$ export PATH=:/usr/bin/pg_config
postgres@dev-postgres-1:~/ODBC-Link-1.0.4$ make USE_PGXS=1
Command 'make' is available in '/usr/bin/make'
The command could not be located because '/usr/bin' is not included in the PATH environment variable.
make: command not found
postgres@dev-postgres-1:~/ODBC-Link-1.0.4$ export PATH=:/usr/bin
postgres@dev-postgres-1:~/ODBC-Link-1.0.4$ make USE_PGXS=1
Makefile:12: /usr/lib/postgresql/8.4/lib/pgxs/src/makefiles/pgxs.mk: No such file or directory
make: *** No rule to make target `/usr/lib/postgresql/8.4/lib/pgxs/src/makefiles/pgxs.mk'. Stop.
postgres@dev-postgres-1:~/ODBC-Link-1.0.4$ sudo apt-get install postgresql-dev
[sudo] password for postgres:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package postgresql-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
libpq-dev
E: Package postgresql-dev has no installation candidate
postgres@dev-postgres-1:~/ODBC-Link-1.0.4$ sudo apt-get install libpq-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libpq-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 11 not upgraded.


All times are GMT -5. The time now is 08:03 PM.