Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 935641B31A53 for ; Thu, 24 May 2012 03:31:44 -0300 (ADT) Received: from plane.gmane.org ([80.91.229.3]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SXRaH-0004Uv-G3 for pgsql-sql@postgresql.org; Thu, 24 May 2012 06:31:43 +0000 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SXRZw-000815-T4 for pgsql-sql@postgresql.org; Thu, 24 May 2012 08:31:20 +0200 Received: from ip-118-90-75-239.xdsl.xnet.co.nz ([118.90.75.239]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 24 May 2012 08:31:20 +0200 Received: from jasen by ip-118-90-75-239.xdsl.xnet.co.nz with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 24 May 2012 08:31:20 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-sql@postgresql.org From: Jasen Betts Subject: Re: Understanding Binary Data Type Date: 24 May 2012 06:09:32 GMT Organization: Dis (not Dat) Organisation Lines: 35 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: ip-118-90-75-239.xdsl.xnet.co.nz X-Face: ?)Aw4rXwN5u0~$nqKj`xPz>xHCwgi^q+^?Ri*+R(&uv2=E1Q0Zk(>h!~o2ID@6{uf8s; a +M[5[U[QT7xFN%^gR"=tuJw%TXXR'Fp~W; (T"1(739R%m0Yyyv*gkGoPA.$b,D.w:z+<'"=-lVT?6 {T?=R^:W5g|E2#EhjKCa+nt":4b}dU7GYB*HBxn&Td$@f%.kl^:7X8rQWd[NTc"P"u6nkisze/Q; 8 "9Z{peQF,w)7UjV$c|RO/mQW/NMgWfr5*$-Z%u46"/00mx-,\R'fLPe.)^ User-Agent: slrn/pre1.0.0-18 (Linux) X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201205/73 X-Sequence-Number: 36621 On 2012-05-22, Carlos Mennens 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