Re: storing files in postgres - Mailing list pgsql-general

From Joshua D. Drake
Subject Re: storing files in postgres
Date
Msg-id 1112291047.30190.4.camel@jd2.commandprompt.com
Whole thread Raw
In response to storing files in postgres  ("Bob Powell" <bob@hotchkiss.org>)
List pgsql-general
On Thu, 2005-03-31 at 12:03 -0500, Bob Powell wrote:
> -->
> Hello everyone,
>
> I have created a table as follows:
>
> CREATE TABLE document (
> image_id int,
> image bytea
> );
>
> I want to insert a complete file, let's say an open office document
> into this table.  Anyone know how I would doe this?

You need to use the bytea functions allocated to your language API.
Which language are you using for this?


>
> Then if I can get the document into the image field, how would I
> retrieve it to display it in my HTML document?

When you say "display" what do you mean? An open office sxw document
is not going to display in an html document. You can link to it or
have it stream to launch an external application though.

Sincerely,

Joshua D. Drake




>
> Thanks in advance.
>
> Bob Powell
> Database Administrator
>
--
Command Prompt, Inc., Your PostgreSQL solutions company. 503-667-4564
Custom programming, 24x7 support, managed services, and hosting
Open Source Authors: plPHP, pgManage, Co-Authors: plPerlNG
Reliable replication, Mammoth Replicator - http://www.commandprompt.com/


pgsql-general by date:

Previous
From: "Joseph M. Day"
Date:
Subject: Re: Temporary Tables
Next
From: "Julian Scarfe"
Date:
Subject: Re: truncate/create slowness