pg.ddx.io pgsql-admin@postgresql.org mailing list archivehelp / color / mirror / Atom feed
Best way to store files inside db 2+ messages / 2 participants [nested] [flat]
* Best way to store files inside db @ 2005-04-13 17:06 Chris Hoover <revoohc@sermonaudio.com> 0 siblings, 1 reply; 2+ messages in thread From: Chris Hoover @ 2005-04-13 17:06 UTC (permalink / raw) To: pgsql-admin I am looking for some help/advice. We need to store some files inside postgres (at least it has been requested of us). What is the best way to do this? Right now, the files are all human readable text files, but that could change. I could store the contents of the human readable files in a text field, but I believe the requester would really like the real file to be stored as close to unmodified as possible. How can I do this? I am thinking to store unmodified, I'll have to use a bytea field. However, how do I tell the database to insert a file (say "c:\test.txt") into the table? Thanks for any help/pointer. Chris ^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Best way to store files inside db @ 2005-04-13 17:41 Joshua D. Drake <jd@commandprompt.com> parent: Chris Hoover <revoohc@sermonaudio.com> 0 siblings, 0 replies; 2+ messages in thread From: Joshua D. Drake @ 2005-04-13 17:41 UTC (permalink / raw) To: Chris Hoover <revoohc@sermonaudio.com>; +Cc: pgsql-admin Chris Hoover wrote: > I am looking for some help/advice. We need to store some files inside > postgres (at least it has been requested of us). What is the best way > to do this? Right now, the files are all human readable text files, but > that could change. It depends on the size of the files. If the files are all reasonably small then bytea is a fine solution. However if you are going to be storing 5 meg PDF or some such thing I would suggest Large Objects. > How can I do this? I am thinking to store unmodified, I'll have to use > a bytea field. However, how do I tell the database to insert a file > (say "c:\test.txt") into the table? http://www.postgresql.org/docs/8.0/interactive/largeobjects.html ALl the language APIs have similar functions. Sincerely, Joshua D. Drake -- Your PostgreSQL solutions provider, Command Prompt, Inc. 24x7 support - 1.800.492.2240, programming, and consulting Home of PostgreSQL Replicator, plPHP, plPerlNG and pgPHPToolkit http://www.commandprompt.com / http://www.postgresql.org ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2005-04-13 17:41 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2005-04-13 17:06 Best way to store files inside db Chris Hoover <revoohc@sermonaudio.com> 2005-04-13 17:41 ` Joshua D. Drake <jd@commandprompt.com>
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