Skip site navigation (1) Skip section navigation (2)

Re: pg_lo_import alternative ...

From: Adam Ruth <adamruth(at)mac(dot)com>
To: kent(at)wareham(dot)k12(dot)ma(dot)us
Cc: pgsql-admin(at)postgresql(dot)org,"Andrei Bintintan" <klodoma(at)ar-sd(dot)net>
Subject: Re: pg_lo_import alternative ...
Date: 2003-11-26 21:33:56
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-admin
I'm storing images and files in the database.  I have a database server 
with all of the binaries and several web servers that attach to it.  
The web servers are for load balancing and each maintain a cache of 
image files locally.  It is the cached images that are served by the 
web servers.  When a request comes in, the web server checks to the 
database server to see if there's a newer file, and if so it downloads 
the file and stores it in the cache.  If not, it just uses the cached 

This helps us out because changes to images and files themselves are 
part of transactions, not just changes to their names.  Backup is 
easier because I don't have to worry about a mismatch between the files 
and the names in the database.  Also, I can have one connection 
changing making changes to a file or image while another downloads the 
last committed version without having to worry about any contention for 

Let me know if you're interested in any of our implementation details.

Adam Ruth

On Nov 26, 2003, at 9:10 AM, kent(at)wareham(dot)k12(dot)ma(dot)us wrote:

> I'm after experiences similar to what you are describing with 
> lo_export. I have used lo_import and ol_export to test image storage 
> and retrival. One problem that you mention is with super user access 
> required to export to the local file system. The second problem is 
> that it seems to add another layer to a web application. A table 
> constructed that contains pointers outside the database seems to be 
> the easiest to deal with in terms of retrieval of images and dislpay 
> within a web page.
> Anyone that that is using Postgres for storage and retrival of images 
> please post your experiences. Thank you.
>> -----Original Message-----
>> From: Andrei Bintintan [mailto:klodoma(at)ar-sd(dot)net]
>> Sent: Wednesday, November 26, 2003 02:20 PM
>> To: 'Daniel Rubio', pgsql-admin(at)postgresql(dot)org
>> Subject: Re: [ADMIN] pg_lo_import alternative ...
>> Are there many images?
>> I do not suggest to store the images in the database. Better save 
>> them on
>> the disk and in the database save only the path to the image. Think 
>> also to
>> the size of the dump(with images).
>> It is more easy to handle this way.
>> This is my opinion.
>> Best regards.
>> Andy.
>> ----- Original Message -----
>> From: "Daniel Rubio" <drubior(at)tinet(dot)org>
>> To: <pgsql-admin(at)postgresql(dot)org>
>> Sent: Wednesday, November 26, 2003 3:58 PM
>> Subject: [ADMIN] pg_lo_import alternative ...
>>> Hi all.
>>> One of our clients wants to store images into his postgres database
>>> hosted by us.
>>> To do this is trying to use the PHP function pg_lo_import, receiving
>>> this error message from server:
>>> Waning: pg_query() []: Query failed: ERROR: You must
>>> have Postgres superuser privilege to use server-side lo_import(). 
>>> Anyone
>>> can use the client-side lo_import() provided by libpq. . in
>>> /apps/web/html/funcions.php on line 121
>>> I can read that there's a client-side function in libpq, but I can't
>>> find any information about it and their use.
>>> Anyone knows something?
>>> --
>>> ********************************************************
>>> Daniel Rubio Rodríguez
>>> OASI (Organisme Autònom Per la Societat de la Informació)
>>> c/ Assalt, 12
>>> 43003 - Tarragona
>>> Tef.: 977.244.007 - Fax: 977.224.517
>>> e-mail: drubio(at)oasi(dot)org
>>> ********************************************************
>>> ---------------------------(end of 
>>> broadcast)---------------------------
>>> TIP 8: explain analyze is your friend
>> ---------------------------(end of 
>> broadcast)---------------------------
>> TIP 3: if posting/reading through Usenet, please send an appropriate
>>      subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
>>      message can get through to the mailing list cleanly
> ---------------------------(end of 
> broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to 
> majordomo(at)postgresql(dot)org)

In response to

pgsql-admin by date

Next:From: Adam RuthDate: 2003-11-26 21:36:10
Subject: Re: pg_lo_import alternative ...
Previous:From: nobodyDate: 2003-11-26 17:52:12
Subject: Re: Vacuum stats interpreted?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group