From: noreply@pgfoundry.org
To: noreply@pgfoundry.org
Subject: [ psqlodbc-Bugs-1000719 ] string representation for large objects ist wrong
Date: Wed, 18 Apr 2007 10:29:02 +0000 (UTC)
Message-ID: <20070418102902.DACF32173DB@pgfoundry.org> (raw)
Bugs item #1000719, was opened at 2006-08-29 15:17
You can respond by visiting:
http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1000719&group_id=1000125
Category: None
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Thomas Zehbe (thomasz)
Assigned to: Hiroshi Inoue (hinoue)
Summary: string representation for large objects ist wrong
Initial Comment:
Trying the db sample of wxWidgets 2.7.0-1 the postgreSQL server logged this message:
LOG: Anweisung: INSERT INTO contacts (NAME,ADDRESS1,ADDRESS2,CITY,STATE,POSTCODE,COUNTRY,JOINDATE,IS_DEV,CONTRIBS,
LINE_CNT,LANGUAGE,PICSIZE,PICTURE) VALUES ('t','','','','','','','1980-01-01 00:00:00'::timestamp,0,0,0,0,28151,'11
8667'::lo)
FEHLER: Typ »lo« existiert nicht
The isnert statement tries to insert a blob and the string represanttion ind psqlodbc driver is actually "lo", wich isn't accepted.
After changing the represantion in 2 files to "oid" blob support works.
I changed the following files:
psqlodbc.h
changed #define PG_TYPE_LO_NAME "lo"
to #define PG_TYPE_LO_NAME "oid"
and
convert.c in the ResolveOneParam() function at line 2983
from sprintf(param_string, "'%d'::lo", lobj_oid);
to sprintf(param_string, "'%d'::oid", lobj_oid);
My versions are psqlodbc 8.01.0200 and PostgreSQL 8.0.1
Hope this helps.
Regards
Thomas
----------------------------------------------------------------------
>Comment By: Thomas Zehbe (thomasz)
Date: 2007-04-18 12:29
Message:
Some days ago I found the reason what I did wrong. I read
the docs of the driver and found the hint that I have to
define the type 'lo' in Postgres. Shame on me :-)
A simple
create domain lo as oid;
did the job.
Sorry for wasting your time.
Regards,
Thomas
----------------------------------------------------------------------
Comment By: Thomas Zehbe (thomasz)
Date: 2006-10-23 09:55
Message:
Hello Hiroshi Inoue,
I aggree that OIDs are not necessarily point to large
objects. But large objects are are represented by oids.A
snippet from 8.0.3 docs: "SELECT lo_creat(-1); --
returns OID of new, empty large object"
Maybe you have overseen the reported Error message:
FEHLER: Typ »lo« existiert nicht
what means in english:
ERROR: Type >lo> doesn't exist
Thats a cleartext message from the servers logfile an is
concerned this part of the insert statement reported:
28151,'118667'::lo
The first part is the number of bytes of the LO, the
second is what the driver generates for the LO. My changes
suggested are leading to this version of insert statement:
24153,'121224'::oid
which is not refused by the server.
I use 8.0.3 currently. Is it misconfigured? Any hints
would be greatly appreciated as the "lo"-version definitly
does not work.
Best Regards,
Thomas
----------------------------------------------------------------------
Comment By: Hiroshi Inoue (hinoue)
Date: 2006-08-30 02:49
Message:
OID doesn't necessarily pointing large objects.
If you are to handle large objects with psqlodbc
driver, please use the type LO.
regards,
Hiroshi Inoue
----------------------------------------------------------------------
You can respond by visiting:
http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1000719&group_id=1000125
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: noreply@pgfoundry.org
Subject: Re: [ psqlodbc-Bugs-1000719 ] string representation for large objects ist wrong
In-Reply-To: <20070418102902.DACF32173DB@pgfoundry.org>
References: <20070418102902.DACF32173DB@pgfoundry.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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