Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 751267591C9 for ; Thu, 24 May 2012 13:36:32 -0300 (ADT) Received: from smtp4-g21.free.fr ([2a01:e0c:1:1599::13]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SXb1X-0004KN-1B for pgsql-sql@postgresql.org; Thu, 24 May 2012 16:36:31 +0000 Received: from [192.168.0.130] (unknown [78.237.44.8]) by smtp4-g21.free.fr (Postfix) with ESMTP id 465C14C81B3 for ; Thu, 24 May 2012 18:36:10 +0200 (CEST) Message-ID: <4FBE6372.1060105@club-internet.fr> Date: Thu, 24 May 2012 18:36:02 +0200 From: "F. BROUARD / SQLpro" Organization: sqlpro.developpez.com User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: Understanding Binary Data Type References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201205/81 X-Sequence-Number: 36629 Hi Le 22/05/2012 19:13, Carlos Mennens a =E9crit : > 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? Actually SQL standard offer the ability to store large datafile directly=20 on the filesystem, but under the control of the RDBMS (the OS cannot=20 read, write or remove the file directly). This concept is based on the=20 DATALINK SQL type. The main advantage is that the file stay exactly as a file and can be=20 transactionned and backuped like all other dataobjects of the database. Some RDBMS like IBM DB2 or MS SQL Server does it (For SQL Server it is=20 called FILESTREAM due to some main differences, but the concept is the=20 same). Actually PG does not offer this feature. A + > > Thanks for any info! > --=20 Fr=E9d=E9ric BROUARD - expert SGBDR et SQL - MVP SQL Server - 06 11 86 40= 66 Le site sur le langage SQL et les SGBDR : http://sqlpro.developpez.com Enseignant Arts & M=E9tiers PACA, ISEN Toulon et CESI/EXIA Aix en Provenc= e Audit, conseil, expertise, formation, mod=E9lisation, tuning, optimisatio= n *********************** http://www.sqlspot.com *************************