Thread: storing files in postgres
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?
Then if I can get the document into the image field, how would I retrieve it to display it in my HTML document?
Thanks in advance.
Bob Powell
Database Administrator
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/