pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rudolf ter Haar <terhaar@dutw38.wbmt.tudelft.nl>
To: pgsql-interfaces@postgresql.org
Subject: Re: A Question about Large Object
Date: Tue, 23 Nov 1999 13:32:28 +0100
Message-ID: <383A895C.CB66D4C1@dutw38.wbmt.tudelft.nl> (raw)
References: <Pine.LNX.4.10.9911221903540.8177-100000@mail.ing.luz.ve>

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.




view thread (2+ messages)

Message-ID: <383A895C.CB66D4C1@dutw38.wbmt.tudelft.nl>
Permalink:  ../383A895C.CB66D4C1@dutw38.wbmt.tudelft.nl/
Also on:    postgresql.org/message-id/383A895C.CB66D4C1@dutw38.wbmt.tudelft.nl

 · 

reply

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-interfaces@postgresql.org
  Cc: terhaar@dutw38.wbmt.tudelft.nl
  Subject: Re: A Question about Large Object
  In-Reply-To: <383A895C.CB66D4C1@dutw38.wbmt.tudelft.nl>
  References: <Pine.LNX.4.10.9911221903540.8177-100000@mail.ing.luz.ve> <383A895C.CB66D4C1@dutw38.wbmt.tudelft.nl>

* 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