[unixODBC-support] Can't connect to PostgreSQL

Maxim muxas at mail.ru
Fri Feb 18 22:33:34 GMT 2005


Hi,

  I'm on FreeBSD 5.3. As the subject says, connection from isql which is
> isql LPU
fails with this description of the error in  /tmp/sql.log:

[ODBC][1040][SQLConnect.c][3526]
                 Entry:
                         Connection = 0x805b000
                         Server Name = [LPU][length = 3 (SQL_NTS)]
                         User Name = [][length = 0 (SQL_NTS)]
                         Authentication = [][length = 0 (SQL_NTS)]
                 UNICODE Using encoding ASCII 'char' and UNICODE 'UCS-2-INTERNAL'

                 DIAG [IM002] Missing server name, port, or database name in call to CC_connect.

Here is the set of config files:

**************** /usr/local/etc/odbcinst.ini:

[ODBC]
Trace = yes
TraceFile = /tmp/sql.log

[PostgreSQL]
Description             = PostgreSQL driver FreeBSD
Driver          = /usr/local/lib/psqlodbc.so
Setup           = /usr/local/lib/psqlodbc.so
Fetch           = 100
CommLog         = 0
Debug           = 0
Optimizer               = 1
Ksqo            = 1
UniqueIndex             = 1
ReadOnly                = 0
UseDeclareFetch         = 0
UnknownSizes            = 0
TextAsLongVarchar               = 1
UnknownsAsLongVarchar           = 0
BoolsAsChar             = 1
Parse           = 0
CancelAsFreeStmt                = 0
MaxVarcharSize          = 254
MaxLongVarcharSize              = 8190
ExtraSysTablePrefixes           = dd_;
APILevel                = 1
ConnectFunctions                = YYN
DriverODBCVer           = 03.00
FileUsage               = 0
SQLLevel                = 1
UsageCount              = 1

*************************** ~/.odbc.ini:
[LPU]
Description             = Test to Postgres LPU
Driver          = PostgreSQL
Database                = LPU
Servername              = mobile
Port            = 5432
Username                = muxas
Password                =
Fetch           = 100
CommLog         = 0
Debug           = 1
Optimizer               = 1
Ksqo            = 1
UniqueIndex             = 1
UseDeclareFetch         = 0
UnknownSizes            = 0
TextAsLongVarchar               = 1
UnknownsAsLongVarchar           = 0
BoolsAsChar             = 1
Parse           = 0
CancelAsFreeStmt                = 0
MaxVarcharSize          = 254
MaxLongVarcharSize              = 8190
ExtraSysTablePrefixes           = dd_;
ReadOnly                = 0
ShowOidColumn           = 0
FakeOidIndex            = 0
RowVersioning           = 0
ShowSystemTables                = 0
Protocol                = 6.4
ConnSettings            =
DisallowPremature               = 0
UpdatableCursors                = 1
LFConversion            = 1
TrueIsMinus1            = 0
BI              = 0
ByteaAsLongVarBinary            = 0
UseServerSidePrepare            = 0
LowerCaseIdentifier             = 0


I guess there is quite simple mistake lying around, but can't find it: the same configuration works
from Windows XP (OpenOffice) fine (actually, I just copied it from win registry). Would be
thankful for any help.

Maxim




More information about the unixODBC-support mailing list