Re: A Question about Large Object

From: Rudolf ter Haar <terhaar(at)dutw38(dot)wbmt(dot)tudelft(dot)nl>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: A Question about Large Object
Date: 1999-11-23 12:32:28
Message-ID: 383A895C.CB66D4C1@dutw38.wbmt.tudelft.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Hi Juan,

I have nearly the same problem as you seem to have.
I am able to store and retrieve files in a PostgreSQL database.
However i only can save and get files wich are on the Linux box where my
postgres server is running.
Is this the case with your problem too ??

Anyway if i tell my visual basic application that it has to store and
retrieve files on the PC (running windows) than i don't have success.
Saving files at the Linux box is no problem.

I do it the following way

This is the SQL statement in the ODBC string. (exporting data on the linux
machine)

SELECT lo_export(juancol.photo,'/tmp/photo') FROM juancol juancol WHERE
(juancol.name='nicephoto');

(importing data from the linux machine)

INSERT INTO juancol (juancol.name, juancol.photo) VALUES ('nicephoto',
lo_import('/usr2/terhaar/photo.jpg'));

I think it is a good idea to work with a unique key to get the photo and to
store the photo, so that we do not get misunderstandings.

Do not forget to think of setting open the directory for writing, with chmod
xxx or something.
I hope this will work for you .

Anyway my problem is that i can not write or read to a PC directly..
Did you solve this with psql ???

Kind regards

Rudolf ter Haar.

Juan Colmenares wrote:

> Hello.
>
> I'm trying to store a jpeg file into a table created as follow:
>
> CREATE TABLE juancol (
> name text,
> photo oid
> );
>
> I can insert a jpeg file from pgsql (locally) but I can not do this from
> an
> application written in Visual Basic using an ODBC driver (V06-40-0006).
>
> I read psqlodbc FAQs (Can I use large objects or OLE?) but I wouldn't
> have to deal with clean-up tasks.
>
> Someone could tell me any suggestion?
>
> Thanks in advance!
>
> Juan Andres.

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Hiroshi Inoue 1999-11-23 13:17:40 Re: [INTERFACES] table very big !!!!!
Previous Message Rafal Piotrowski (CSCS) 1999-11-23 11:19:51 LargeObject.write(byte[] buf) method