Re: column type for pdf file

From: Eric McKeeth <eldin00(at)gmail(dot)com>
To: emilu(at)encs(dot)concordia(dot)ca
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: column type for pdf file
Date: 2011-05-18 23:06:36
Message-ID: BANLkTimpYJk2=D8TUFDjWRQLmQNfRa_d=Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Wed, May 18, 2011 at 2:20 PM, Emi Lu <emilu(at)encs(dot)concordia(dot)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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message David W Noon 2011-05-19 00:09:07 Re: foreign keys and lots of tables
Previous Message Ozer, Pam 2011-05-18 22:22:00 Re: Sorting Issue