PostGreSQL

From: "Sivasakthi d/o Sivagnanam" <sakthi(at)digicert(dot)com(dot)my>
To: <pgsql-odbc(at)postgresql(dot)org>, <pgsql-odbc-owner(at)postgresql(dot)org>
Subject: PostGreSQL
Date: 2005-03-16 11:16:09
Message-ID: 006101c52a19$8e15a7a0$9701a8c0@digicert2003.com.my
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Hi,
My problem is when I tried to test the odbc connection(/usr/local/bin/iodbctest ... DSN=PgSQL), it failed with the following error:-
"[root(at)openldap2 bin]# 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
------------------------------------------------------------------------------
PgSQL | PostgreSQL

Enter ODBC connect string (? shows list): DSN=PgSQL
1: SQLDriverConnect = [iODBC][Driver Manager]/usr/local/lib/psqlodbc.so: undefined symbol: ucs2_to_utf8 (0) SQLSTATE=00000
2: SQLDriverConnect = [iODBC][Driver Manager]Specified driver could not be loaded (0) SQLSTATE=IM003
"

I'm trying to get OpenLDAP to work with PostgreSQL. I did the installation and configuration as per link: http://www.samse.fr/GPL/ldap_pg/HOWTO/x37.html on how to get OpenLDAP to work with PostgresSQL. Please note the errors i've encountered during compilation[refer to Step3]....could that have something to do with why my connection failed ?
The versions of softwares are:-
a.. PostgreSQL[from postgresql-8.0.1.tar.gz]
b.. iODBC [from libiodbc-3.52.2.tar.gz]
c.. PostgreSQL ODCB Driver[from psqlodbc-08.00.0101.tar.gz]
d.. OpenLDAP[2.2.23]
Step1: Compiled PostgreSQL and created database pg_ldap and set allowed host as local connection using authentication=password [Status=OK]
./configure
gmake
su
gmake install
adduser postgres
mkdir /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
su - postgres
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
/usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data >logfile 2>&1 &
/usr/local/pgsql/bin/createdb pg_ldap
/usr/local/pgsql/bin/psql pg_ldap

Step2: Compiled iODBC [Status=OK]
./configure --with-iodbc-inidir=/etc
make
make install

Step3: Compiled PostgreSQL... [Status=Failed]...the details are:-
Action1: ./configure --with-iodbc- --with-odbcinst=/etc [Status=Failed]... the error was:-
"checking size of long... configure: error: cannot compute sizeof (long), 77
See `config.log' for more details."
Resolution: Following advise in this link http://emacs-w3m.namazu.org/ml/msg07449.html, I've set export LDFLAGS='-Xlinker -R/usr/local/lib'

Action1 again: ./configure --with-iodbc- --with-odbcinst=/etc [Status=OK]
Action2: make [Status=Failed]...the error was
"make all-am
make[1]: Entering directory `/usr/src/redhat/code_to_compile_latestldap/psqlodbc-08.00.0101'
if /bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -MT odbcapi30w.lo -MD -MP -MF ".deps/odbcapi30w.Tpo" \
-c -o odbcapi30w.lo `test -f 'odbcapi30w.c' || echo './'`odbcapi30w.c; \
then mv -f ".deps/odbcapi30w.Tpo" ".deps/odbcapi30w.Plo"; \
else rm -f ".deps/odbcapi30w.Tpo"; exit 1; \
fi
gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -MT odbcapi30w.lo -MD -MP -MF .deps/odbcapi30w.Tpo -c odbcapi30w.c -fPIC -DPIC -o .libs/odbcapi30w.o
odbcapi30w.c:238: conflicting types for `SQLColAttributeW'
/usr/local/include/sqlucode.h:122: previous declaration of `SQLColAttributeW'
make[1]: *** [odbcapi30w.lo] Error 1
make[1]: Leaving directory `/usr/src/redhat/code_to_compile_latestldap/psqlodbc-08.00.0101'
make: *** [all] Error 2
"
Resolution: I'm not sure how to resolve this...the only thing i could think off is to comment those items. So I commented in 2 places where "SQLColAttributeW" appeared in /usr/local/include/sqlucode.h

Action2 again: make [Status=Failed]...the old error disappeared but the new error was
"make all-am
make[1]: Entering directory `/usr/src/redhat/code_to_compile_latestldap/psqlodbc-08.00.0101'
if /bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -MT odbcapi30.lo -MD -MP -MF ".deps/odbcapi30.Tpo" \
-c -o odbcapi30.lo `test -f 'odbcapi30.c' || echo './'`odbcapi30.c; \
then mv -f ".deps/odbcapi30.Tpo" ".deps/odbcapi30.Plo"; \
else rm -f ".deps/odbcapi30.Tpo"; exit 1; \
fi
gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -MT odbcapi30.lo -MD -MP -MF .deps/odbcapi30.Tpo -c odbcapi30.c -fPIC -DPIC -o .libs/odbcapi30.o
odbcapi30.c:108: conflicting types for `SQLColAttribute'
/usr/local/include/sql.h:840: previous declaration of `SQLColAttribute'
make[1]: *** [odbcapi30.lo] Error 1
make[1]: Leaving directory `/usr/src/redhat/code_to_compile_latestldap/psqlodbc-08.00.0101'
make: *** [all] Error 2
"
Resolution: I'm not sure how to resolve this...the only thing i could think off is to comment those items. So I commented "SQLColAttribute" in /usr/local/include/sql.h

Action2 again: make [Status=OK]
Action3: make install

Step4: Compile OpenLDAP
Action1: ./configure --enable-sql --without-cyrus-sasl --disable-bdb --enable-crypt [Status=OK]
Action2: make depend [Status=OK]
Action3: make [Status=OK]
Action4: make install [Status=OK]

Step5: Test ODBC Connection
Error as reported above.

Hope you could help me.

.sakthi

Browse pgsql-odbc by date

  From Date Subject
Next Message Bhabani Sankar Jena 2005-03-16 11:18:23 I need help on ODBC Driver testing ...
Previous Message Greg Campbell 2005-03-15 21:29:17 Re: [Maybe Spam] something is corrupting the data