ODBC and configure

ODBC and configure

am 27.07.2010 08:48:20 von Ravi Katkar

--_000_46AC8D44F3AE1F4888F137837D0DF63508853EE010INHYWEXMB2i nf_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi List,

I have installed ODBC and configure the same in RHEL 4.4.

Configured the ODBC in the following way:

[ODBC Data Sources]
testPSQL =3D PostgreSQL Test

[testPSQL]
Driver=3D/usr/lib/psqlodbc.so
Description=3DSample PostgreSQL DSN
DSN=3DtestPSQL
SERVER=3Dxhost+localhost
Username=3Dpostgres
Database=3Drtdb
ReadOnly=3DNo
Servertype=3Dpostgres
Port=3D5432
FetchBufferSize=3D99
ServerOptions=3D
ConnectOptions=3D
Options=3D
ReadOnlyi=3Dno
Trace=3D1
TraceFile=3D/home/postgres/odbc.trace
Debug=3D1
DebugFile =3D /home/postgres/odbc.debug
CommLog =3D 1

[Default]
Driver =3D /usr/lib/psqlodbc.so
Description =3D PostgreSQL Data Source
SERVER=3Dlocalhost
Port=3D5432
UserName=3Dpostgres
Password=3Dpostgres
;Socket=3D4096
;end odbc.ini

[ODBC]
InstallDir =3D /usr/lib/libiodbc.so


#===================3D=3 D=====
==================== =====3D=
==================== =====3D=
===3D#

Steps that I followed to test the ODBC is :


1. Downloaded the "odbctest.c" file from website and copied into unix mac=
hine
2. Compile and run the file
Problem:
While running odbctest testPSQL earlier it was working fine, but now e=
verytime its giving the below error:
odbctest: cannot connect to X server

Please suggest if there is any solution for this. I tried with SERVER=3Dloc=
alhost and xhost+localhost, again Severname=3Dlocalhost and xhost+localhost=
nothing is working after re-compiling and running the .c file.

Thanks,
Ravi Katkar

--_000_46AC8D44F3AE1F4888F137837D0DF63508853EE010INHYWEXMB2i nf_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:st1=3D"urn:schemas-microsoft-com:office:smarttags" xmlns=3D"http://ww=
w.w3.org/TR/REC-html40">




name=3D"place"/>









:10.0pt;
font-family:Verdana'>Hi List,



:10.0pt;
font-family:Verdana'> 



:10.0pt;
font-family:Verdana'>I have installed ODBC and configure the same in RHEL 4=
..4.



:10.0pt;
font-family:Verdana'> 



ize:10.0pt;
font-family:Verdana'>Configured the ODBC in the following way: span>



:10.0pt;
font-family:Verdana'> 



na> style=3D'font-size:10.0pt;font-family:Verdana'>[ODBC Data Sources] p>



na> style=3D'font-size:10.0pt;font-family:Verdana'>testPSQL =3D PostgreSQL Test=



na> style=3D'font-size:10.0pt;font-family:Verdana'>  nt>



na> style=3D'font-size:10.0pt;font-family:Verdana'>[testPSQL]=



na> style=3D'font-size:10.0pt;font-family:Verdana'>Driver=3D/usr /lib/psqlodbc.s=
o



na> style=3D'font-size:10.0pt;font-family:Verdana'>Description=3 DSample Postgre=
SQL DSN



na> style=3D'font-size:10.0pt;font-family:Verdana'>DSN=3DtestPSQ L pan>



na> style=3D'font-size:10.0pt;font-family:Verdana'>SERVER=3Dxhos t+localhost >



na> style=3D'font-size:10.0pt;font-family:Verdana'>Username=3Dpo stgres p>



na> style=3D'font-size:10.0pt;font-family:Verdana'>Database=3Drt db span>



na> style=3D'font-size:10.0pt;font-family:Verdana'>ReadOnly=3DNo an>



na> style=3D'font-size:10.0pt;font-family:Verdana'>Servertype=3D postgres o:p>



na> style=3D'font-size:10.0pt;font-family:Verdana'>Port=3D5432 >



na> style=3D'font-size:10.0pt;font-family:Verdana'>FetchBufferSi ze=3D99 :p>



na> style=3D'font-size:10.0pt;font-family:Verdana'>ServerOptions =3D<=
/span>



na> style=3D'font-size:10.0pt;font-family:Verdana'>ConnectOption s=3D=



na> style=3D'font-size:10.0pt;font-family:Verdana'>Options=3D=



na> style=3D'font-size:10.0pt;font-family:Verdana'>ReadOnlyi=3Dn o pan>



na> style=3D'font-size:10.0pt;font-family:Verdana'>Trace=3D1<=
/font>



na> style=3D'font-size:10.0pt;font-family:Verdana'>TraceFile=3D/ home/postgres/o=
dbc.trace



na> style=3D'font-size:10.0pt;font-family:Verdana'>Debug=3D1<=
/font>



na> style=3D'font-size:10.0pt;font-family:Verdana'>DebugFile =3D
/home/postgres/odbc.debug



na> style=3D'font-size:10.0pt;font-family:Verdana'>CommLog =3D 1 an>



na> style=3D'font-size:10.0pt;font-family:Verdana'>  nt>



na> style=3D'font-size:10.0pt;font-family:Verdana'>[Default]<=
/font>



na> style=3D'font-size:10.0pt;font-family:Verdana'>Driver =3D /usr/lib/psqlodbc=
..so



na> style=3D'font-size:10.0pt;font-family:Verdana'>Description =3D PostgreSQL D=
ata
Source



na> style=3D'font-size:10.0pt;font-family:Verdana'>SERVER=3Dloca lhost >



na> style=3D'font-size:10.0pt;font-family:Verdana'>Port=3D5432 >



na> style=3D'font-size:10.0pt;font-family:Verdana'>UserName=3Dpo stgres p>



na> style=3D'font-size:10.0pt;font-family:Verdana'>Password=3Dpo stgres p>



na> style=3D'font-size:10.0pt;font-family:Verdana'>;Socket=3D409 6 pan>



na> style=3D'font-size:10.0pt;font-family:Verdana'>;end odbc.ini an>



na> style=3D'font-size:10.0pt;font-family:Verdana'>  nt>



na> style=3D'font-size:10.0pt;font-family:Verdana'>[ODBC] nt>



na> style=3D'font-size:10.0pt;font-family:Verdana'>InstallDir =3D /usr/lib/libi=
odbc.so



:10.0pt;
font-family:Verdana'> 



:10.0pt;
font-family:Verdana'> 



:10.0pt;
font-family:Verdana'>#=============3 D=====
==================== =====3D=
==================== =====3D=
==========#



:10.0pt;
font-family:Verdana'> 



:10.0pt;
font-family:Verdana'>Steps that I followed to test the ODBC is :=



:10.0pt;
font-family:Verdana'> 




  1. e=3DVerdana> style=3D'font-size:10.0pt;font-family:Verdana'>Downloaded the “o=
    dbctest.c”
    file from website and copied into unix machine
    e=3D2
    face=3DVerdana> :p>

  2. e=3DVerdana> style=3D'font-size:10.0pt;font-family:Verdana'>Compile and run the fil=
    e

    ily:Verdana'>



ize:10.0pt;
font-family:Verdana;font-weight:bold'>Problem:
=



:10.0pt;
font-family:Verdana'>     While running style=3D'font-weight:bold'>odbctest testPSQL
earlier it was work=
ing
fine, but now everytime its giving the below error: >



:10.0pt;
font-family:Verdana'>     :bold'>odbctest:
cannot connect to X server



:10.0pt;
font-family:Verdana'> 



:10.0pt;
font-family:Verdana'>Please suggest if there is any solution for this. I tr=
ied
with SERVER=3Dlocalhost and xhost+localhost, again Severname=3Dlocalhost an=
d
xhost+localhost nothing is working after re-compiling and running the .c fi=
le.
   



:10.0pt;
font-family:Verdana'> 



=3D'font-size:
10.0pt;font-family:Arial;color:navy'>Thanks,



e=3DArial> style=3D'font-size:10.0pt;font-family:Arial;color:navy'>Ravi=
size=3D2 color=3Dnavy face=3DArial> ily:Arial;
color:navy'> Katkar









--_000_46AC8D44F3AE1F4888F137837D0DF63508853EE010INHYWEXMB2i nf_--

Re: ODBC and configure

am 27.07.2010 10:06:41 von Craig Ringer

On 27/07/10 14:48, Ravi Katkar wrote:

> 1. Downloaded the "odbctest.c" file from website and copied into unix machine
> 2. Compile and run the file
> Problem:
> While running odbctest testPSQL earlier it was working fine, but now everytime its giving the below error:
> odbctest: cannot connect to X server

This isn't a PostgreSQL problem.

Your 'odbctest.c' (where *did* you get that, anyway? What URL?) appears
to be using a GUI toolkit that requires an X11 graphical environment.
That's what "cannot connect to X server" refers to ; it's nothing to do
with the PostgreSQL server.

If you have an X11 server running on your local machine, connect to the
machine odbctest is on using "ssh -X" to enable ssh X11 forwarding. Then
odbctest should run over the SSH X11 tunnel.

Otherwise, compile odbctest without any GUI requirements. Without some
idea of where you got "odbctest.c" and what it is, I can't really help
you with that.

--
Craig Ringer

--
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc

Re: ODBC and configure

am 27.07.2010 12:23:05 von Ravi Katkar

Odbctest.c downloaded from the below website http://wwwmath.uni-muenster.de=
/u/beckelu/DB0506/ODBC/

Please refer if I can get the same .c file from other location.

Its not using GUI toolkit .

-----Original Message-----
From: Craig Ringer [mailto:craig@postnewspapers.com.au]=20
Sent: Tuesday, July 27, 2010 1:37 PM
To: Ravi Katkar
Cc: 'pgsql-odbc@postgresql.org'
Subject: Re: [ODBC] ODBC and configure

On 27/07/10 14:48, Ravi Katkar wrote:

> 1. Downloaded the "odbctest.c" file from website and copied into unix m=
achine
> 2. Compile and run the file
> Problem:
> While running odbctest testPSQL earlier it was working fine, but now=
everytime its giving the below error:
> odbctest: cannot connect to X server

This isn't a PostgreSQL problem.

Your 'odbctest.c' (where *did* you get that, anyway? What URL?) appears
to be using a GUI toolkit that requires an X11 graphical environment.
That's what "cannot connect to X server" refers to ; it's nothing to do
with the PostgreSQL server.

If you have an X11 server running on your local machine, connect to the
machine odbctest is on using "ssh -X" to enable ssh X11 forwarding. Then
odbctest should run over the SSH X11 tunnel.

Otherwise, compile odbctest without any GUI requirements. Without some
idea of where you got "odbctest.c" and what it is, I can't really help
you with that.

--
Craig Ringer

--=20
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc

Re: ODBC and configure

am 27.07.2010 13:08:52 von Craig Ringer

On 27/07/10 18:23, Ravi Katkar wrote:
> Odbctest.c downloaded from the below website http://wwwmath.uni-muenster.de/u/beckelu/DB0506/ODBC/

> Its not using GUI toolkit .

Nope, it certainly isn't. But something seems to be trying to talk to
your X server, unless that message is somehow weirdly misleading.

Here, installing unixodbc from debian packages and compiling odbctest as:

gcc -o odbctest odbctest.c -lodbc

it runs fine with DISPLAY unset (ie with no access to an X server).

My next step in your position would be to strace the binary to see what
it's doing, use ldd to examine what it's linking to, or use LD_DEBUG to
trace what libraries it accesses. Though, of course, I'd also know how
I'd compiled it, which you didn't mention.

In any case, though, there's no sign this issue has anything to do with
PostgreSQL. I hope this sets you vaguely on the right track, but I'm not
really into ODBC at the best of times, so I think I might be about done
with my usefulness here.

--
Craig Ringer

--
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc

Re: ODBC and configure

am 27.07.2010 16:31:25 von Tom Lane

Craig Ringer writes:
> On 27/07/10 18:23, Ravi Katkar wrote:
>> Odbctest.c downloaded from the below website http://wwwmath.uni-muenster.de/u/beckelu/DB0506/ODBC/

>> Its not using GUI toolkit .

> Nope, it certainly isn't. But something seems to be trying to talk to
> your X server, unless that message is somehow weirdly misleading.

There's a program called odbctest in (some releases of) the unixODBC
package. I suspect Ravi is executing that, not his own program.

regards, tom lane

--
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc

Re: ODBC and configure

am 28.07.2010 06:53:02 von Ravi Katkar

Hi Tom,=20

You are right I am executing odbcTest program in unix odbc package.

Regards,
Ravi Katkar=20

-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]=20
Sent: Tuesday, July 27, 2010 8:01 PM
To: Craig Ringer
Cc: Ravi Katkar; 'pgsql-odbc@postgresql.org'
Subject: Re: [ODBC] ODBC and configure=20

Craig Ringer writes:
> On 27/07/10 18:23, Ravi Katkar wrote:
>> Odbctest.c downloaded from the below website http://wwwmath.uni-muenster=
..de/u/beckelu/DB0506/ODBC/

>> Its not using GUI toolkit .

> Nope, it certainly isn't. But something seems to be trying to talk to
> your X server, unless that message is somehow weirdly misleading.

There's a program called odbctest in (some releases of) the unixODBC
package. I suspect Ravi is executing that, not his own program.

regards, tom lane

--=20
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc