On Wed, May 18, 2011 at 2:20 PM, Emi Lu <em...@encs.concordia.ca> 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 storing a reference to a file stored outside the database is preferable. However, to answer the question you asked, my rule of thumb is that if you need to store binary data in the database is to use a bytea column, unless you need the random access capabilities that the large object interface provides. A bytea column is typically easier to use, and has proper transactional behavior, enforcement of referential integrity, etc. -Eric