Re: [SQL] column type for pdf file

2011-05-26 Thread Ross J. Reedstrom
On Wed, May 18, 2011 at 05:06:36PM -0600, Eric McKeeth wrote: > On Wed, May 18, 2011 at 2:20 PM, Emi Lu wrote: > > > Hello, > > > > To save pdf files into postgresql8.3, what is the best column type? > > > > bytea, blob, etc? > > > > Thank you, > > Emi > > > > Everyone else has pointed out reaso

Re: [SQL] column type for pdf file

2011-05-19 Thread Emi Lu
Craig, Karsten, Hardly everyone. You lose transaction safety when using file system storage outside the DB, you need another way to talk to the server than just the Pg connection, and most importantly your backups become more complicated because you have two things to back up. It's not simple,

Re: [SQL] column type for pdf file

2011-05-19 Thread Craig Ringer
On 05/19/2011 09:53 PM, Karsten Hilbert wrote: On Thu, May 19, 2011 at 09:39:54AM -0400, Emi Lu wrote: All right, it seems that everyone thinks saving a pdf into postgresql is not a good idea. No. Hardly everyone. You lose transaction safety when using file system storage outside the DB, y

Re: [SQL] column type for pdf file

2011-05-19 Thread Karsten Hilbert
On Thu, May 19, 2011 at 09:39:54AM -0400, Emi Lu wrote: > All right, it seems that everyone thinks saving a pdf into postgresql > is not a good idea. No. > As a summary, disadvantages are: > == > . Memory issue when read/save/retrieve the file > . Increase load T

Re: [SQL] column type for pdf file

2011-05-19 Thread Emi Lu
Hello all, All right, it seems that everyone thinks saving a pdf into postgresql is not a good idea. My situation is: = . pdf file: 500kb . One year I need to save around 65 files = 32M As a summary, disadvantages are: == . Memory issue when

Re: [SQL] column type for pdf file

2011-05-18 Thread Piotr Czekalski
Right! The external binary file storage has another advantage (that may be considered as disadvantage as well) - it is usually easier to develop and test mechanism as you're able to browse uploaded file result using os / application or even "exchange" file contents for test purposes, while in

Re: [SQL] column type for pdf file

2011-05-18 Thread Craig Ringer
On 05/19/2011 05:21 AM, Julien Cigar wrote: On 05/18/2011 23:00, Karsten Hilbert wrote: On Wed, May 18, 2011 at 10:46:23PM +0200, Julien Cigar wrote: Unless you've good reasons to do so it's best to store the file on the file system Why ? If you suggest reasons are needed for storing the PDF

Re: [SQL] column type for pdf file

2011-05-18 Thread Eric McKeeth
On Wed, May 18, 2011 at 2:20 PM, Emi Lu wrote: > Hello, > > To save pdf files into postgresql8.3, what is the best column type? > > bytea, blob, etc? > > Thank you, > Emi > Everyone else has pointed out reasons for not doing this, and I agree with them that in the large majority of cases just st

Re: [SQL] column type for pdf file

2011-05-18 Thread Julien Cigar
On 05/18/2011 23:27, Karsten Hilbert wrote: On Wed, May 18, 2011 at 11:21:43PM +0200, Julien Cigar wrote: Unless you've good reasons to do so it's best to store the file on the file system Why ? If you suggest reasons are needed for storing the PDF in the database I'd like to know the reasons

Re: [SQL] column type for pdf file

2011-05-18 Thread Karsten Hilbert
On Wed, May 18, 2011 at 11:21:43PM +0200, Julien Cigar wrote: > >>Unless you've good reasons to do so it's best to store the file on > >>the file system > >Why ? > > > >If you suggest reasons are needed for storing the PDF in the > >database I'd like to know the reasons for *not* doing so. > > It

Re: [SQL] column type for pdf file

2011-05-18 Thread Julien Cigar
On 05/18/2011 23:00, Karsten Hilbert wrote: On Wed, May 18, 2011 at 10:46:23PM +0200, Julien Cigar wrote: Unless you've good reasons to do so it's best to store the file on the file system Why ? If you suggest reasons are needed for storing the PDF in the database I'd like to know the reasons

Re: [SQL] column type for pdf file

2011-05-18 Thread Karsten Hilbert
On Wed, May 18, 2011 at 10:46:23PM +0200, Julien Cigar wrote: > Unless you've good reasons to do so it's best to store the file on > the file system Why ? If you suggest reasons are needed for storing the PDF in the database I'd like to know the reasons for *not* doing so. Karsten -- GPG key I

Re: [SQL] column type for pdf file

2011-05-18 Thread Julien Cigar
Unless you've good reasons to do so it's best to store the file on the file system and the file name/path in the database ... On 05/18/2011 22:20, Emi Lu wrote: Hello, To save pdf files into postgresql8.3, what is the best column type? bytea, blob, etc? Thank you, Emi <> -- Sent via pgsq

[SQL] column type for pdf file

2011-05-18 Thread Emi Lu
Hello, To save pdf files into postgresql8.3, what is the best column type? bytea, blob, etc? Thank you, Emi -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql