Re: usage of option ByteaAsLongVarBinary?

From: Ludek Finstrle <luf(at)pzkagis(dot)cz>
To: "Nardmann, Heiko" <heiko(dot)nardmann(at)secunet(dot)com>
Cc: pgsql-odbc(at)postgresql(dot)org
Subject: Re: usage of option ByteaAsLongVarBinary?
Date: 2006-08-01 12:20:39
Message-ID: 20060801122039.GA11586@soptik.pzkagis.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Tue, Aug 01, 2006 at 12:33:43PM +0200, Nardmann, Heiko wrote:
> Am Dienstag, 1. August 2006 12:05 schrieb Ludek Finstrle:
> > > am not sure how to set this. I have thought that this would be possible
> > > by setting "ByteaAsLongVarBinary=1" inside of the odbc.ini. But without
> > > luck.
> >
> > Yes. This is the right way. Do you have it at the right place in
> > odbc.ini?
>
> Not sure about it; here my odbc.ini:
>
> [ODBC]
> Trace = 1
> TraceFile = /tmp/unixodbc.trace.log
> debug=1
> debugfile=/tmp/unixodbc.debug.log
>
> [test-db]
> Description = test-db
> driver=/usr/lib/unixODBC/libodbcpsql.so
> setup=/usr/lib/unixODBC/libodbcpsqlS.so
> trace=1
> tracefile=/tmp/unixodbc.trace.log
> debug=1
> debugfile=/tmp/unixodbc.debug.log

debugfile isn't correct. trace is unixodbc option debug is psqlodbc optin.

> commlog=1
> database=test-db
> Servername=1.2.3.4
> Port=5432
> Username=
> ReadOnly=0
> ByteaAsLongVarBinary=1

It seems ok.

> > > Once again I had a look at the sources - then I did not find any other
> > > way to set it than setting it via the specified Windows GUI. Since I do
> > > use Linux
> >
> > I see this way (function calls):
> > PGAPI_DriverConnect
> > dconn_get_connect_attributes
> > dconn_get_attributes
> > copyAttributes
> >
>
> So do I have to use SQLDriverConnect() instead of SQLConnect() to have
> PGAPI_DriverConnect() to be used?

No I see the way in PGAPI_Connect too:
PGAPI_Connect
getDSNinfo

There is:
if (ci->bytea_as_longvarbinary < 0 || overwrite)
{
SQLGetPrivateProfileString(DSN, INI_BYTEAASLONGVARBINARY, "", temp, sizeof(temp), ODBC_INI);
if (temp[0])
ci->bytea_as_longvarbinary = atoi(temp);
}

How are you connecting? Please send us the row with SQLConnect and
the DSN value. Something like:
SQLConnect(hdbc,dsn,user,pass);
dsn = 'mydsn';

or

SQLConnect(hdbc,'mydsn',user,pass);

Are you able to use gdb to trace down the getDSNinfo?

Regards,

Luf

In response to

Browse pgsql-odbc by date

  From Date Subject
Next Message ben sewell 2006-08-01 12:59:04 ODBC Connection failed after importing linked tables
Previous Message Nardmann, Heiko 2006-08-01 10:48:52 Re: usage of option ByteaAsLongVarBinary?