pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Sivasakthi d/o Sivagnanam <sakthi@digicert.com.my>
To: pgsql-odbc@postgresql.org
To: pgsql-odbc-owner@postgresql.org
Subject: PostGreSQL
Date: Wed, 16 Mar 2005 19:16:09 +0800
Message-ID: <006101c52a19$8e15a7a0$9701a8c0@digicert2003.com.my> (raw)

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@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

Message-ID: <006101c52a19$8e15a7a0$9701a8c0@digicert2003.com.my>
Permalink:  ../006101c52a19$8e15a7a0$9701a8c0@digicert2003.com.my/
Also on:    postgresql.org/message-id/006101c52a19$8e15a7a0$9701a8c0@digicert2003.com.my

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: sakthi@digicert.com.my, pgsql-odbc-owner@postgresql.org
  Subject: Re: PostGreSQL
  In-Reply-To: <006101c52a19$8e15a7a0$9701a8c0@digicert2003.com.my>
  References: <006101c52a19$8e15a7a0$9701a8c0@digicert2003.com.my>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox