Re: inserting blob data

From: "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk>
To: "Bruce Holt" <bj_holt(at)hotmail(dot)com>
Cc: <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: inserting blob data
Date: 2002-11-27 21:46:29
Message-ID: 03AF4E498C591348A42FC93DEA9661B884EB@mail.vale-housing.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

> -----Original Message-----
> From: Bruce Holt [mailto:bj_holt(at)hotmail(dot)com]
> Sent: 27 November 2002 20:48
> To: tgl(at)sss(dot)pgh(dot)pa(dot)us
> Cc: pgsql-odbc(at)postgresql(dot)org
> Subject: Re: [ODBC] inserting blob data
>
>
> "Bruce Holt" <bj_holt(at)hotmail(dot)com> writes:
> >> Hmm, the 8K limit has been gone for a long time. You
> didn't mention >> your Postgres server's version, but I'm
> betting you need to update >> either your server or your
> ODBC driver. Possibly both.
>
> > PostgreSQL 7.2.2 on i686-pc-linux-gnu, compiled by GCC gcc
> (GCC) 3.2
>
> >And your ODBC driver was up to date too, right? So much for that
> >theory. How exactly are you trying to store the blob data? (A code
> >snippet would be an appropriate answer, probably.)
>
> I am using the ADO for VB example found at:
> http://odbc.postgresql.org/psqlodbc.php?> DocID=howto-vblo
>
>
> I
> have tried three table structures as
> well:
>
> # create table MYTABLE (main integer, object bytea);
> # create table MYTABLE (main integer, object oid);
> # create table MYTABLE (main integer, object text);
>
> I can insert the data correctly, and save it to the server
> using the # select lo_export(#####, '/mypath/myfile');
> command. I just can't retrieve the blob data via ODBC.

There is a setting in the driver called MaxLongVarChar which defaults to
8190 bytes. You are almost certainly hitting this when you use the third
table definition. The second will only store an 8(?) byte integer. Dunno
about the first, though I've heard bytea should work.

The example you quote requires a table that looks like:

CREATE TABLE MYTABLE(main integer, object lo);

If you don't have a lo datatype, this will help:
http://gborg.postgresql.org/project/psqlodbc/faq/faq.php?faq_id=52

Regards, Dave.

Browse pgsql-odbc by date

  From Date Subject
Next Message Dave Page 2002-11-27 21:56:21 Re: Can't get more than 255 chars out of memo field in Acc
Previous Message Justin Clift 2002-11-27 21:35:23 Re: Can't get more than 255 chars out of memo field in Acc