Thread: Check postgres compile-time options
Hello, I have an old binary RPM distribution of Postgres (7.1.2), and I am trying to switch from the proprietary interface to the ODBC interface so that I can upgrade my servers to a more up-to-date version. In trying to get the ODBC installed on my test system, I've run into the problem that I need to know if my binary distribution of PostgreSQL was configured with the --enable-odbc option, and I can't seem to find out how to do that. I could've sworn I'd seen in the list how to display how postgres was compiled, but I've been searching the list archives for about an hour or more, and I can't find it. I'm sure that within minutes, someone will point out the specific email that has it. The documentation also says that I could go into the source tree (src/interfaces/odbc) and type make ; make install, but I can't find that directory structure anywhere on my system. The documentation that told me about this is the programmers reference for 7.1.2 These are the postgreSQL packages that are installed, and below are the odbc packages installed. I know this is an old version, but as I said, I need to switch my software to odbc to upgrade, because just upgrading postgres breaks the software that I've written. #rpm -q -a | grep -i postgres postgresql-server-7.1.2-19mdk postgresql-libs-7.1.2-19mdk postgresql-perl-7.1.2-19mdk postgresql-devel-7.1.2-19mdk postgresql-7.1.2-19mdk postgresql-odbc-7.1.2-19mdk # rpm -q -a | grep -i odbc unixODBC-2.0.8-7mdk libiodbc-3.52.2-1 libunixODBC2-2.0.8-7mdk unixODBC-gui-gtk-2.0.8-7mdk libiodbc-admin-3.52.2-1 postgresql-odbc-7.1.2-19mdk libiodbc-devel-3.52.2-1 Thanks in advance for any help. -- Thanks, Laura Vance Systems Engineer Winfree Academy Charter Schools
On Mon, Aug 01, 2005 at 05:18:58PM -0500, Laura Vance wrote: > In trying to get the ODBC installed on my test system, I've run > into the problem that I need to know if my binary distribution of > PostgreSQL was configured with the --enable-odbc option, and I can't > seem to find out how to do that. Are you looking for "pg_config --configure"? http://www.postgresql.org/docs/7.1/static/app-pgconfig.html I think pg_config reports the configure options that were in effect when *it* was compiled, so if pg_config is from a different build than the postmaster then the options pg_config reports might not match those that the postmaster was built with (somebody please correct me if I'm mistaken). -- Michael Fuhr http://www.fuhr.org/~mfuhr/
Michael Fuhr wrote: >On Mon, Aug 01, 2005 at 05:18:58PM -0500, Laura Vance wrote: > > >>In trying to get the ODBC installed on my test system, I've run >>into the problem that I need to know if my binary distribution of >>PostgreSQL was configured with the --enable-odbc option, and I can't >>seem to find out how to do that. >> >> > >Are you looking for "pg_config --configure"? > >http://www.postgresql.org/docs/7.1/static/app-pgconfig.html > >I think pg_config reports the configure options that were in effect >when *it* was compiled, so if pg_config is from a different build >than the postmaster then the options pg_config reports might not >match those that the postmaster was built with (somebody please >correct me if I'm mistaken). > > > If that isn't the right one, then I'm not sure. # pg_config --configure --disable-rpath --enable-hba --enable-locale --enable-multibyte --enable-syslog --with-CXX *--with-odbc* --with-perl --with-python --with-readline --with-tcl --with-tk --with-x --datadir=/usr/share/pgsql --docdir=/usr/share/doc --includedir=/usr/include/pgsql --mandir=/usr/share/man --prefix=/usr --sysconfdir=/etc/pgsql I put asterisks around the "--with-odbc" Here's a little background on what I've tried to get the postgres/ODBC working. I went to the postgresql web site and found the section for programming interfaces and clicked on the "odbc" link. It took me to a page at GBorg for ODBC. I clicked on the link for "HOWTOs" then on the link for PostgreSQL & ODBC on Redhat (since my current system is a Mandrake system that uses red hat rpm's). I followed the instructions and was able to compile the little test program. The problem I run into is when I run the iodbc test program it gives me the following output/errors: $ iodbctest "DSN=tpeims;UID=vancel;PWD=" iODBC Demonstration program This program shows an interactive SQL processor Driver Manager: 03.52.0205.0204 1: SQLDriverConnect = Unknown connect option (Set) (205) SQLSTATE=S1009 Have a nice day. Then when I run it interactively instead of command line, it does this: $ iodbctest iODBC Demonstration program This program shows an interactive SQL processor Driver Manager: 03.52.0205.0204 Enter ODBC connect string (? shows list): ? DSN | Driver ------------------------------------------------------------------------------ tpeims | PostgreSQL driver Enter ODBC connect string (? shows list): tpeims 1: SQLDriverConnect = Unknown connect option (Set) (205) SQLSTATE=S1009 Have a nice day. I've tried other configuration test programs, but none of them seem to connect properly. Is there some incompatibility with this version of iodbc and postgresql 7.1.2? Also, if this needs to be taken to pgsql-odbc, let me know, but there doesn't seem to be much activity on that list (I'm not subscribed to it yet) -- Thanks, Laura Vance Systems Engineer
El Lun 01 Ago 2005 20:13, Laura Vance escribió: > > I've tried other configuration test programs, but none of them seem to > connect properly. > > Is there some incompatibility with this version of iodbc and postgresql > 7.1.2? Sorry, I happen to recall that you wanted this to upgrade the PG system. Why don't you just use pg_dumpall on the PG 7.1.2 instalation, save the output file, upgrade to a newer version (try 8.0.3), and restore the backup with psql? Much easier. -- select 'mmarques' || '@' || 'unl.edu.ar' AS email; --------------------------------------------------------- Martín Marqués | Programador, DBA Centro de Telemática | Administrador Universidad Nacional del Litoral ---------------------------------------------------------
Martín Marqués wrote: >El Lun 01 Ago 2005 20:13, Laura Vance escribió: > > >>I've tried other configuration test programs, but none of them seem to >>connect properly. >> >>Is there some incompatibility with this version of iodbc and postgresql >>7.1.2? >> >> > >Sorry, I happen to recall that you wanted this to upgrade the PG system. Why >don't you just use pg_dumpall on the PG 7.1.2 instalation, save the output >file, upgrade to a newer version (try 8.0.3), and restore the backup with >psql? Much easier. > > > I'm not worried about upgrading the database, that part will be easy as you indicated. My problem has nothing to do with upgrading the server side, it's upgrading my applications. The problem goes something like this: I installed PostgreSQL back in 1999 for a senior project I was doing in college. It came in Linux Mandrake 6.5. I wrote some wrapper modules that wrapped the Pg.pm functions with my own functions. Everything was good, and I liked the database engine. I upgraded to Mandrake 7.1 and the respective PostgreSQL database engine. Pg.pm was still there, so my apps still worked just fine. Everything was still good. I upgraded to Mandrake 8.1 and the respective PostgreSQL database engine (7.1.2-19mdk). Pg.pm was still there, and now I decided that I wanted to write some C++ applications that used PostgreSQL also, so I researched how to use libpq++.so. Everything was good. I even got a job implementing my software and writing more. From there, Mandrake 9.1 had a flaw with script execution, so I couldn't upgrade to it. Now I have to upgrade to Fedora Core 4, which uses a much higher version of PostgreSQL. Unfortunately the Pg.pm support is gone (it's wrapped by DBI/DBD, which wasn't that hard to convert my apps, and they work except for some inconsistent errors that I'll figure out later), and libpq++.so is gone (which is where the hard part seems to be coming in). So I have a choice... I can either rewrite my interface for the new proprietary objects for PostgreSQL or I can convert my apps to use the ODBC driver and not have to worry as much on future upgrades. The problem is that I got bitten in the behind by my choice to avoid ODBC and use the proprietary PostgreSQL drivers. It's unfortunate that they dropped the support, but it's their choice. The bad part is that it's the sole thing that's been keeping me from upgrading. -- Thanks, Laura Vance Systems Engineer
Laura Vance <vancel@winfreeacademy.com> writes: > Now I have to upgrade to Fedora Core 4, which uses a much higher version > of PostgreSQL. Unfortunately the Pg.pm support is gone (it's wrapped by > DBI/DBD, which wasn't that hard to convert my apps, and they work except > for some inconsistent errors that I'll figure out later), and libpq++.so > is gone (which is where the hard part seems to be coming in). libpq++ is still around, it's just not bundled into the core Postgres distribution anymore. Look on pgfoundry.org or gborg.postgresql.org. I'm pretty sure you can still get Pg.pm too if you want it. regards, tom lane
On Mon, Aug 01, 2005 at 08:32:17PM -0400, Tom Lane wrote: > Laura Vance <vancel@winfreeacademy.com> writes: > > Now I have to upgrade to Fedora Core 4, which uses a much higher version > > of PostgreSQL. Unfortunately the Pg.pm support is gone (it's wrapped by > > DBI/DBD, which wasn't that hard to convert my apps, and they work except > > for some inconsistent errors that I'll figure out later), and libpq++.so > > is gone (which is where the hard part seems to be coming in). > > libpq++ is still around, it's just not bundled into the core Postgres > distribution anymore. Look on pgfoundry.org or gborg.postgresql.org. > I'm pretty sure you can still get Pg.pm too if you want it. Pg.pm is called "pgperl" and it's registered as a project on gborg. I'm not sure if they ever "released" any files there, but you can get the code via CVS and it works flawlessly. -- Alvaro Herrera (<alvherre[a]alvh.no-ip.org>) "La espina, desde que nace, ya pincha" (Proverbio africano)