Re: column type for pdf file - Mailing list pgsql-sql

From Eric McKeeth
Subject Re: column type for pdf file
Date
Msg-id BANLkTimpYJk2=D8TUFDjWRQLmQNfRa_d=Q@mail.gmail.com
Whole thread Raw
In response to column type for pdf file  (Emi Lu <emilu@encs.concordia.ca>)
Responses Re: column type for pdf file  ("Ross J. Reedstrom" <reedstrm@rice.edu>)
List pgsql-sql
<div class="gmail_quote">On Wed, May 18, 2011 at 2:20 PM, Emi Lu <span dir="ltr"><<a
href="mailto:emilu@encs.concordia.ca">emilu@encs.concordia.ca</a>></span>wrote:<br /><blockquote class="gmail_quote"
style="margin:00 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> Hello,<br /><br /> To save pdf files into
postgresql8.3,what is the best column type?<br /><br /> bytea, blob, etc?<br /><br /> Thank you,<br /> Emi<font
color="#888888"></font><br/></blockquote></div><br />Everyone else has pointed out reasons for not doing this, and I
agreewith 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
databaseis 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.<br /><br />-Eric<br /> 

pgsql-sql by date:

Previous
From: "Ozer, Pam"
Date:
Subject: Re: Sorting Issue
Next
From: David W Noon
Date:
Subject: Re: foreign keys and lots of tables