Re: photos and OID's

From: "Richard Huxton" <dev(at)archonet(dot)com>
To: "Mark" <mark(at)zserve(dot)com>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: photos and OID's
Date: 2001-05-24 23:28:39
Message-ID: 006101c0e4a9$57989fc0$1001a8c0@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

From: "Mark" <mark(at)zserve(dot)com>

> We store photos in the db and serve them up from web servers. We're
> using java servlets on separate web server boxes that are load balanced.
> NFS is not an option for us (unless nothing else is available). This
> works with byte streams using SQL Server from MS. But, we don't want to
> use SQL Server any more, we want to use PostgreSQL.
>
> We need to get the photo data from the db without any file system
> access. In other words, we need the bytes, not the OID.
>
> So I read docs and found lo_import/lo_export. But that would only work
> for us over NFS and would cause major complications. lo_export won't
> cut it for us unless we make some major changes. Can I use the standard
> JDBC Blob type to retrieve the photos? What other options do I have?

I'm no expert on Java, but it looks like the JDBC interface (ch 8.5) takes
InputStream and OutputStream as parameters for lo_import/lo_export. Can you
not then tie them to whatever image class you use?

File access is needed at the database end (it stores the lo's in separate
files) but not on your client webservers.

Hopefully that's what you're after, but you might want to wait around for a
second opinion.

- Richard Huxton

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Keith Gray 2001-05-25 06:30:17 Re: where's ALTER TABLE table DROP [ COLUMN ] column???
Previous Message Reinoud van Leeuwen 2001-05-24 22:54:05 Re: Stored Procedures?