Inserting large objects

From: "Nisha Joseph" <nishatreesa(at)hotmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Inserting large objects
Date: 2003-01-28 14:24:30
Message-ID: F736TTVjrTwgzxEMKby00000015@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi there,

I have a problem with the windows 32 odbc driver for postgres.

I have written an application in visual C++ 6 that can read/write in any
table on the postgreSql server through ODBC, But now I want to put a
picture (large object) in the database. The odbc driver FAQ said I had to
create a new type, called lo, which I did, but that still get's me nowhere.
create type lo (
internallength=4,
externallength=10,
input=int4in,
output=int4out,
default='',
passedbyvalue
);

create table photographs(
id integer,
data lo,
name varchar(30),
);

How can I read a picture from the database? Can I just use an SQL query
and select the picture from the database, or do I have to use some of
the functions in the drivers DLL?

The same thing goes for writing an image to the database. How do I insert
the pictures into the photgraphs table?

I have read that the lo datatype is mapped to LONGVARBINARY. Does that
mean all the data is stored in the format LONGVARBINARY or just the oid?

thanx

_________________________________________________________________
Use MSN Messenger to send music and pics to your friends
http://messenger.msn.co.uk

Browse pgsql-general by date

  From Date Subject
Next Message Mark Cave-Ayland 2003-01-28 14:25:32 Ref to last INSERT on a table without OIDs?
Previous Message Shridhar Daithankar 2003-01-28 14:09:23 Re: Using RSYNC for replication?