From: | Alanoly Andrews <alanolya(at)invera(dot)com> |
---|---|
To: | "'pgsql-odbc(at)postgresql(dot)org'" <pgsql-odbc(at)postgresql(dot)org> |
Cc: | 'Adrian Klaver' <adrian(dot)klaver(at)aklaver(dot)com> |
Subject: | FW: [GENERAL] Re: [ADMIN] Cannot retrieve images inserted through VB and odbc, after a table reorganization. |
Date: | 2014-09-08 14:03:03 |
Message-ID: | 2f7103a1a1ff4bd28ba0cd9d71f92c6e@exch1.invera.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-odbc |
Hello experts in postgres-odbc,
The following was the latest in a series of posts that I had made to the admin and general discussion groups. This post contains an excerpt from the log produced by the postgres odbc client when an attempt was made to retrieve an image stored on a backend postgres database (AIX server). The postgres database is 9.1.4 version. The column containing the image is defined as type "lo". The SQL is a simple one of the type "select image from table where image_key=keyvalue". In the early part of the log all return codes are 0. When the return code is 1, we get the "The buffer was too small for the GetData" and "Error reading from large object" messages. Would any of you know what these messages mean and how we can get around the problem? The code for sql retrieval is written in VB code. It should be noted that the same image(s) are retrievable through non VB/ODBC applications.
Feedback very much appreciated.
Alanoly Andrews.
-----Original Message-----
From: Alanoly Andrews
Sent: Friday, September 05, 2014 11:33 AM
To: 'Adrian Klaver'; 'Craig James'
Cc: pgsql-admin(at)postgresql(dot)org; pgsql-general(at)postgresql(dot)org
Subject: RE: [GENERAL] Re: [ADMIN] Cannot retrieve images inserted through VB and odbc, after a table reorganization.
Hi Adrian,
1. We are storing our large objects in a table column whose datatype is "lo" (which, I understand, ultimately is in fact "bytea").
2. The error messge returned to the VB is, yes, very generic. And the backend postgres server does not have any messages relevant to this issue.
3. We set the trace on in the odbc driver and got a large log file, from which I give below the part that I think is significant. It refers to the "buffer size being too small". Where, in the odc settings, do we set the buffer size?
STELimageViewOn 834-fec EXIT SQLGetData with return code 1 (SQL_SUCCESS_WITH_INFO)
HSTMT 0x002BFC70
UWORD 2
SWORD 1 <SQL_C_CHAR>
PTR 0x0018EECF [ 0] ""
SQLLEN 0
SQLLEN * 0x0018EEA4 (6)
DIAG [01004] The buffer was too small for the GetData. (-2)
STELimageViewOn 834-fec ENTER SQLGetData
HSTMT 0x002BFC70
UWORD 2
SWORD -2 <SQL_C_BINARY>
PTR <unknown type>
SQLLEN 0
SQLLEN * 0x0018EE54
STELimageViewOn 834-fec EXIT SQLGetData with return code 1 (SQL_SUCCESS_WITH_INFO)
HSTMT 0x002BFC70
UWORD 2
SWORD -2 <SQL_C_BINARY>
PTR <unknown type>
SQLLEN 0
SQLLEN * 0x0018EE54 (46165)
DIAG [01004] The buffer was too small for the GetData. (-2)
STELimageViewOn 834-fec ENTER SQLGetData
HSTMT 0x002BFC70
UWORD 2
SWORD -2 <SQL_C_BINARY>
PTR <unknown type>
SQLLEN 32768
SQLLEN * 0x003CE284
STELimageViewOn 834-fec EXIT SQLGetData with return code -1 (SQL_ERROR)
HSTMT 0x002BFC70
UWORD 2
SWORD -2 <SQL_C_BINARY>
PTR <unknown type>
SQLLEN 32768
SQLLEN * 0x003CE284
DIAG [S1000] Error reading from large object. (1)
-----Original Message-----
From: Adrian Klaver [mailto:adrian(dot)klaver(at)aklaver(dot)com]
Sent: Thursday, September 04, 2014 4:43 PM
To: Alanoly Andrews; 'Craig James'
Cc: pgsql-admin(at)postgresql(dot)org; pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] Re: [ADMIN] Cannot retrieve images inserted through VB and odbc, after a table reorganization.
On 09/04/2014 08:03 AM, Alanoly Andrews wrote:
> Thanks, Adrian for the response.
>
> Yes, we are using the "large object" as per the specifications in the
> special "lo" module that we installed on the backend server. The table
> is created using the "lo" datatype for the image field and the table
> is being regularly used for insertions and retrievals using utilities
> other than ones using odbc. The odbc connection, too, works well on
> the table, as long as the table data is not reorganized after insertion(s).
>
> Here are three pages of our postgres odbc driver settings. Sorry, they
> are screen captures, not plain text!
Hmm, to me at least nothing seems out of place. Though to be honest I am not sure what 'Bytea as LO' does in this situation.
Are you actually trying to store any large objects in bytea columns?
I searched on the error message you originally posted, but is fairly generic and covers a lot of different error sources.
So, is there any more specific error information in either the Postgres or ODBC logs?
>
> Alanoly.
--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com
________________________________
If you no longer wish to receive any of our emails, click on UNSUBSCRIBE.<mailto:unsubscribe(at)invera(dot)com?subject=***Unsubscribe***> This e-mail may be privileged and/or confidential, and the sender does not waive any related rights and obligations. Any distribution, use or copying of this e-mail or the information it contains by other than an intended recipient is unauthorized. If you received this e-mail in error, please advise me (by return e-mail or otherwise) immediately.
Si vous ne désirez plus recevoir de nos courriels, veuillez appuyer sur DÉSABONNEMENT.<mailto:unsubscribe(at)invera(dot)com?subject=***Unsubscribe***> Ce courriel est confidentiel et protégé. L'expéditeur ne renonce pas aux droits et obligations qui s'y rapportent. Toute diffusion, utilisation ou copie de ce message ou des renseignements qu'il contient par une personne autre que le (les) destinataire(s) désigné(s) est interdite. Si vous recevez ce courriel par erreur, veuillez m'en aviser immédiatement, par retour de courriel ou par un autre moyen.
From | Date | Subject | |
---|---|---|---|
Next Message | perry@processlinx.com | 2014-09-08 17:39:11 | Abort! |
Previous Message | Heikki Linnakangas | 2014-09-05 18:13:19 | Buffer overflows in SQLGetData corner cases |