[unixODBC-support] OSX 10.7 and Postgres

Nick Gorham nick at lurcher.org
Tue Aug 28 19:57:47 BST 2012


On 28/08/2012 19:05, Gallagher James wrote:
> 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 ( < 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

Try

isql -v unixODBC postgres x

first to see if it connects, then try the command with -v so you get a display of any errors.

-- 
Nick



More information about the unixODBC-support mailing list