X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id C4A02329FAE for ; Tue, 19 Oct 2004 18:52:16 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 81877-09 for ; Tue, 19 Oct 2004 17:52:06 +0000 (GMT) Received: from mta02.onolab.com (smtp.ono.com [62.42.230.12]) by svr1.postgresql.org (Postfix) with ESMTP id 0AA1B329D86 for ; Tue, 19 Oct 2004 18:52:03 +0100 (BST) Received: from [192.168.1.101] (84.122.176.213) by mta02.onolab.com (7.1.016.11) (authenticated as juanmime) id 415C438A00149E12; Tue, 19 Oct 2004 19:51:46 +0200 Message-ID: <41755431.4050408@ono.com> Date: Tue, 19 Oct 2004 19:51:45 +0200 From: Juan Miguel User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.1) Gecko/20040707 X-Accept-Language: es-es, en-us, en MIME-Version: 1.0 To: Peter Eisentraut Cc: macdickson , pgsql-admin@postgresql.org Subject: Re: How to store jpeg files in Postgres Database References: <200410151825.12438.peter_e@gmx.net> In-Reply-To: <200410151825.12438.peter_e@gmx.net> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/240 X-Sequence-Number: 15233 Peter Eisentraut wrote: >Am Freitag, 15. Oktober 2004 08:37 schrieb macdickson: > > >>Can any one tell me how to store jpegh files in Postgres Database >> >> > >Use the data type "bytea". > > > First, Sorry about my english. I use the "lo" type (see contrib folder). This is similar to oid type, but helps you managing the deletion of a record. For example, when you delete a record where a column contains a OID reference, postgres does not delete de large object referenced. If the type of a column is lo, you could create a trigger that perform the function lo_manage given by the library of "lo", that automaticaly delete the large object. In this case, the column only stores the object identifier (imagine an integer), instead of the full image like a bytea column. ¿ Why I use "lo" or "oid" ? Because when you connect to a database via ODBC, the "lo" or "oid" column's type is recognized like a "blob field", then I can link this field with grids or other controls that show the content (a JPG image for example).