pg.ddx.io pgsql-odbc@postgresql.org mailing list archive
help / color / mirror / Atom feedusage of option ByteaAsLongVarBinary?
5+ messages / 2 participants
[nested] [flat]
* usage of option ByteaAsLongVarBinary?
@ 2006-08-01 07:16 Nardmann, Heiko <heiko.nardmann@secunet.com>
2006-08-01 10:05 ` Re: usage of option ByteaAsLongVarBinary? Ludek Finstrle <luf@pzkagis.cz>
2006-08-01 10:48 ` Re: usage of option ByteaAsLongVarBinary? Nardmann, Heiko <heiko.nardmann@secunet.com>
0 siblings, 2 replies; 5+ messages in thread
From: Nardmann, Heiko @ 2006-08-01 07:16 UTC (permalink / raw)
To: pgsql-odbc
Hi,
first to say that I am quite new to the ODBC interface ...
Now my question:
I want the ODBC driver (Linux/unixODBC) to map an incoming SQL_LOGVARBINARY to
BYTEA. Examining pgtypes.c I have seen that seems to be possible if the
bytea_as_longvarbinary member of the connection structure is set. Now ... I
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.
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
what is my way to set it? Do I have to go via the ODBC HDBC handle? Any
examples for this?
Thanks in advance!
--
Heiko Nardmann (Dipl.-Ing. Technische Informatik)
secunet Security Networks AG - Sicherheit in Netzwerken (www.secunet.de),
Weidenauer Str. 223-225, D-57076 Siegen
Tel. : +49 271 48950-13, Fax : +49 271 48950-50
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: usage of option ByteaAsLongVarBinary?
2006-08-01 07:16 usage of option ByteaAsLongVarBinary? Nardmann, Heiko <heiko.nardmann@secunet.com>
@ 2006-08-01 10:05 ` Ludek Finstrle <luf@pzkagis.cz>
2006-08-01 10:33 ` Re: usage of option ByteaAsLongVarBinary? Nardmann, Heiko <heiko.nardmann@secunet.com>
1 sibling, 1 reply; 5+ messages in thread
From: Ludek Finstrle @ 2006-08-01 10:05 UTC (permalink / raw)
To: Nardmann, Heiko <heiko.nardmann@secunet.com>; +Cc: pgsql-odbc
> 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?
> 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
> what is my way to set it? Do I have to go via the ODBC HDBC handle? Any
> examples for this?
There is no such way.
It could be useful to try enable the mylog output (Debug = 1 in odbc.ini).
The mylog is placed in /tmp/mylog_*.log.
BTW could you send us the odbc.ini to check it?
Regards,
Luf
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: usage of option ByteaAsLongVarBinary?
2006-08-01 07:16 usage of option ByteaAsLongVarBinary? Nardmann, Heiko <heiko.nardmann@secunet.com>
2006-08-01 10:05 ` Re: usage of option ByteaAsLongVarBinary? Ludek Finstrle <luf@pzkagis.cz>
@ 2006-08-01 10:33 ` Nardmann, Heiko <heiko.nardmann@secunet.com>
2006-08-01 12:20 ` Re: usage of option ByteaAsLongVarBinary? Ludek Finstrle <luf@pzkagis.cz>
0 siblings, 1 reply; 5+ messages in thread
From: Nardmann, Heiko @ 2006-08-01 10:33 UTC (permalink / raw)
To: Ludek Finstrle <luf@pzkagis.cz>; +Cc: pgsql-odbc
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
commlog=1
database=test-db
Servername=1.2.3.4
Port=5432
Username=
ReadOnly=0
ByteaAsLongVarBinary=1
> > 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?
Thanks for your help.
> > what is my way to set it? Do I have to go via the ODBC HDBC handle? Any
> > examples for this?
>
> There is no such way.
>
> It could be useful to try enable the mylog output (Debug = 1 in odbc.ini).
> The mylog is placed in /tmp/mylog_*.log.
>
> BTW could you send us the odbc.ini to check it?
>
> Regards,
>
> Luf
--
Heiko Nardmann (Dipl.-Ing. Technische Informatik)
secunet Security Networks AG - Sicherheit in Netzwerken (www.secunet.de),
Weidenauer Str. 223-225, D-57076 Siegen
Tel. : +49 271 48950-13, Fax : +49 271 48950-50
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: usage of option ByteaAsLongVarBinary?
2006-08-01 07:16 usage of option ByteaAsLongVarBinary? Nardmann, Heiko <heiko.nardmann@secunet.com>
2006-08-01 10:05 ` Re: usage of option ByteaAsLongVarBinary? Ludek Finstrle <luf@pzkagis.cz>
2006-08-01 10:33 ` Re: usage of option ByteaAsLongVarBinary? Nardmann, Heiko <heiko.nardmann@secunet.com>
@ 2006-08-01 12:20 ` Ludek Finstrle <luf@pzkagis.cz>
0 siblings, 0 replies; 5+ messages in thread
From: Ludek Finstrle @ 2006-08-01 12:20 UTC (permalink / raw)
To: Nardmann, Heiko <heiko.nardmann@secunet.com>; +Cc: 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
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: usage of option ByteaAsLongVarBinary?
2006-08-01 07:16 usage of option ByteaAsLongVarBinary? Nardmann, Heiko <heiko.nardmann@secunet.com>
@ 2006-08-01 10:48 ` Nardmann, Heiko <heiko.nardmann@secunet.com>
1 sibling, 0 replies; 5+ messages in thread
From: Nardmann, Heiko @ 2006-08-01 10:48 UTC (permalink / raw)
To: pgsql-odbc
Am Dienstag, 1. August 2006 09:16 schrieb Nardmann, Heiko:
> Hi,
>
> first to say that I am quite new to the ODBC interface ...
>
> Now my question:
>
> I want the ODBC driver (Linux/unixODBC) to map an incoming SQL_LOGVARBINARY
> to BYTEA. Examining pgtypes.c I have seen that seems to be possible if the
> bytea_as_longvarbinary member of the connection structure is set. Now ... I
> 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.
> 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 what is my way to set it? Do I have to go via the ODBC HDBC handle?
> Any examples for this?
>
> Thanks in advance!
One additional question: I saw that bytea_as_longvarbinary is initialized to
'-1' in connection.c inside of CC_conninfo_init(). Does that mean that by
default this option is activated?
--
Heiko Nardmann (Dipl.-Ing. Technische Informatik)
secunet Security Networks AG - Sicherheit in Netzwerken (www.secunet.de),
Weidenauer Str. 223-225, D-57076 Siegen
Tel. : +49 271 48950-13, Fax : +49 271 48950-50
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2006-08-01 12:20 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-08-01 07:16 usage of option ByteaAsLongVarBinary? Nardmann, Heiko <heiko.nardmann@secunet.com>
2006-08-01 10:05 ` Ludek Finstrle <luf@pzkagis.cz>
2006-08-01 10:33 ` Nardmann, Heiko <heiko.nardmann@secunet.com>
2006-08-01 12:20 ` Ludek Finstrle <luf@pzkagis.cz>
2006-08-01 10:48 ` Nardmann, Heiko <heiko.nardmann@secunet.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox