0
votes

My unixodbc can connect to PostgreSQL,but the unixodbc always write the wrong trace file. I set the trace file in /tmp/odbc.log but unixodbc always write it in /tmp/sql.log. Where are wrong in my setting?

---odbcinst -j---

unixODBC 2.3.2

DRIVERS............: /usr/local/unixodbc/etc/odbcinst.ini

SYSTEM DATA SOURCES: /usr/local/unixodbc/etc/odbc.ini

FILE DATA SOURCES..: /usr/local/unixodbc/etc/ODBCDataSources

USER DATA SOURCES..: /root/.odbc.ini

SQLULEN Size.......: 4

SQLLEN Size........: 4

SQLSETPOSIROW Size.: 2

---odbc.ini---

[root@mynewdb_test bin]# cat /usr/local/unixodbc/etc/odbc.ini

[PostgreSQL]

Driver = pg

Description = Test2PG

Servername = 10.2.22.155

PORT = 5444

Database = testdb

password = u1

---odbcinst.ini---

[root@mynewdb_test bin]# cat /usr/local/unixodbc/etc/odbcinst.ini

[pg]

driver=/usr/local/93AS/connectors/odbc/lib/edb-odbc.so

Trace = yes TraceFile = /tmp/odbc.log

Thank you.

4

4 Answers

0
votes

can you just try like below:

cat /usr/local/unixodbc/etc/odbcinst.ini

[pg]

driver=/usr/local/93AS/connectors/odbc/lib/edb-odbc.so

[ODBC]

TraceFile=/tmp/odbc.log

Trace=1

Also,please delete the previous entries in both file

0
votes

I have the same problem and see this question. This works for me. Hope it can help others.

Add this to odbcinst.ini

[ODBC]
Trace        = Yes
TraceFile    = /tmp/sql.log
ForceTrace   = Yes

Source: FreeTDS Logging

0
votes

User file i.e /home/user/.odbcinst.ini gets overwritten somehow please try to add it in /etc/odbcinst.ini which should take effect.

0
votes

I have the same problem and here my solutions

nano /etc/odbcinst.ini and add this

[ODBC]
Trace      = Yes
TraceFile  = /tmp/odbc.log
ForceTrace = Yes

but that didn't work for me,and i changed Trace File Directory like this;

 TraceFile =/home/your_user/tmp/odbc.txt

after this changed odbc trace start worked.