From: Jasen Betts <jasen@xnet.co.nz>
To: pgsql-sql@postgresql.org
Subject: Re: Understanding Binary Data Type
Date: 24 May 2012 06:09:32 GMT
Message-ID: <jpkjas$e4c$1@reversiblemaps.ath.cx> (raw)
References: <CAAQLLO5pEuf5ZQYYWY1h9DGkpnZ-30VQEaDX9e=gjVcF4ayHGw@mail.gmail.com>
On 2012-05-22, Carlos Mennens <carlos.mennens@gmail.com> wrote:
> Hello everyone! I wanted to ask the list a question about the 'bytea'
> data type & how I can picture this in my head. I've been reading SQL
> for about a few months now and since then, I've only been working with
> textual data. Basically I'm familiar with storing text and numerical
> characters into tables but my friend told me that databases can hold
> much more than just ASCI text. In so I've read up on some pages that
> describe the bytea data type:
>
> http://en.wikipedia.org/wiki/Binary_large_object
>
> http://www.postgresql.org/docs/9.1/static/datatype-binary.html
>
> So my question is can and in fact does PostgreSQL and most other RDBMS
> have the ability to store large binary files like photos, music, etc
> etc into an actual table? I'm guessing the data is dumped into the
> table but rather linked or parsed through the file system store path
> into the database itself, right? I would just like to know in a basic
> round about way how databases store and handle large files like .jpg
> or .png files & regardless how relative this term is, how common is it
> to use these files or 'bytea' data in tables?
>
> Thanks for any info!
postgres has a maximum logical row size just under 2GiB so there's plenty of
room there for photos etc (DVD images might not fit).
postgres uses a strategy called TOAST to move "wide" values out of the
file that holds the main table.
implementation detals:
http://www.postgresql.org/docs/9.1/static/storage-toast.html
--
⚂⚃ 100% natural
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: jasen@xnet.co.nz
Subject: Re: Understanding Binary Data Type
In-Reply-To: <jpkjas$e4c$1@reversiblemaps.ath.cx>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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