pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Juan Miguel <juanmime@ono.com>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: macdickson <mfernandes@phildigital.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: How to store jpeg files in Postgres Database
Date: Tue, 19 Oct 2004 19:51:45 +0200
Message-ID: <41755431.4050408@ono.com> (raw)
In-Reply-To: <200410151825.12438.peter_e@gmx.net>
References: <opsfwfcvj0et60rg@macdickson>
	<200410151825.12438.peter_e@gmx.net>

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).



view thread (3+ messages)

Message-ID: <41755431.4050408@ono.com>
Permalink:  ../41755431.4050408@ono.com/
Also on:    postgresql.org/message-id/41755431.4050408@ono.com

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: juanmime@ono.com, peter_e@gmx.net, mfernandes@phildigital.com
  Subject: Re: How to store jpeg files in Postgres Database
  In-Reply-To: <41755431.4050408@ono.com>
  References: <opsfwfcvj0et60rg@macdickson> <200410151825.12438.peter_e@gmx.net> <41755431.4050408@ono.com>

* 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