[unixODBC-support] OSX 10.7 and Postgres

Gallagher James jgallagher at opendap.org
Tue Aug 28 19:05:16 BST 2012


Hi,

I'm trying to get unixODBC 2.3.1 to work with Postgres 9.1.5 on OSX 10.7. 

I have tried using both the postgres driver bundled with unixODBC and one downloaded from EnterpriseDB at this location (http://www.enterprisedb.com/products-services-training/pgdownload#osx). 

Here's my odbcinst.ini file:
[PostgreSQL]
Description=PostgreSQL driver
Driver=/usr/local/lib/libodbcpsql.dylib
Threading=2
UsageCount=1

[PostgreSQL_Enterprise]
Description=PostgreSQL driver from EnterpriseDB
Driver=/Library/PostgreSQL/psqlODBC/lib/psqlodbcw.so
Threading=2
UsageCount=1

Note that I don't have entries for Server because those libraries don't seem to have been installed. From what I've read they are not required unless I'm using the GUI to configure things.

My odbc.ini file is:
[unixODBC]
Description         = SQLHandler test for POSTGRES
Driver              = PostgreSQL
Trace               = Yes
TraceFile           = sql.log
Database            = postgres
Servername          = localhost
UserName            = postgres
Password            = x
Port                = 5432
Protocol            = 6.4
ReadOnly            = No
RowVersioning       = No
ShowSystemTables    = No
ShowOidColumn       = No
FakeOidIndex        = No
ConnSettings        =

[enterprise]
Description         = SQLHandler test for POSTGRES
Driver              = PostgreSQL_Enterpise
Trace               = Yes
TraceFile           = sql.log
Database            = postgres
Servername          = localhost
UserName            = postgres
Password            = x
Port                = 5432
Protocol            = 6.4
ReadOnly            = No
RowVersioning       = No
ShowSystemTables    = No
ShowOidColumn       = No
FakeOidIndex        = No
ConnSettings        =
jimg:src$ 

When I use isql (isql unixODBC postgres x < sqlh.sql) I get errors:

+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
[ISQL]ERROR: Could not SQLExecute
[ISQL]ERROR: Could not SQLExecute
…

When I use the 'enterprise' DSN, I get:

[ISQL]ERROR: Could not SQLConnect

The file sqlh.sql has some commands to create a table and populate it with a handful of rows.

Thanks,
James
--
James Gallagher
jgallagher at opendap.org
406.723.8663

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 203 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mailman.unixodbc.org/pipermail/unixodbc-support/attachments/20120828/20c54d7f/attachment.bin>


More information about the unixODBC-support mailing list