0

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.

Community
  • 1
  • 1
user3655478
  • 1
  • 1
  • 2

4 Answers4

1

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

Anand
  • 621
  • 3
  • 9
  • 31
1

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

Hei
  • 70
  • 6
1

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.

Murat B.
  • 111
  • 1
  • 1
  • 10
0

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

samuelhard
  • 369
  • 3
  • 14