473,322 Members | 1,287 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

BLOB problem

Hi,

I've encountered a problem with a PostgreSQL database. I made a image
management system which stores images in a database from a PHP script. I
upload te file using pg_lo_import() (PHP function). Everything works
fine, fast, and I was really glad with it, till I found out that my
database is rapadly growing. With only 20 images the database has a size
of 65 MB !!!

Does anybody know where this come from ? I know I don't give a lot of
information, if you want more, ask for it. But I don't want to send
unreadable posts ;-)

Grtz

Nov 22 '05 #1
5 5368
Rens Admiraal <po**********@etraned.nl> writes:
upload te file using pg_lo_import() (PHP function). Everything works
fine, fast, and I was really glad with it, till I found out that my
database is rapadly growing. With only 20 images the database has a size
of 65 MB !!!


Hard to tell much from that statement. I'd suggest looking into the
$PGDATA directory tree to find out which files are taking up the bulk of
the space --- with that info we can give you some advice.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 22 '05 #2
On Tue, 3 Feb 2004, Tom Lane wrote:
Rens Admiraal <po**********@etraned.nl> writes:
upload te file using pg_lo_import() (PHP function). Everything works
fine, fast, and I was really glad with it, till I found out that my
database is rapadly growing. With only 20 images the database has a size
of 65 MB !!!


Hard to tell much from that statement. I'd suggest looking into the
$PGDATA directory tree to find out which files are taking up the bulk of
the space --- with that info we can give you some advice.


Also note, Rens, that a freshly initdb'd database ain't tiny to start
with. template0 and template1 take up about 4 megs each, and each fresh,
"empty" database another 4 or so. This is on my workstation. Plus, each
transaction log is 16 megs or larger if you've reconfigured for more
checkpoints.

So, if you have two empty databases, plus two transactions logs, that'll
add up to 4*4 meg + 2*16 meg for a total of 3*16 or 48 Meg. Before
importing any data.


---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 22 '05 #3
Hello
I've encountered a problem with a PostgreSQL database


Are you sure that the problem is with PostgreSQL?

I was testing pg_lo_import() with PHP 4.3.x and found it buggy. I had
the opposite problem: only a few bytes from a large object were stored
in the database. Then I downgraded to PHP 4.2 and the same script
works well on the same database.

Regards
Conni
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 22 '05 #4
On Wed, 4 Feb 2004, Cornelia Boenigk wrote:
Hello
I've encountered a problem with a PostgreSQL database


Are you sure that the problem is with PostgreSQL?

I was testing pg_lo_import() with PHP 4.3.x and found it buggy. I had
the opposite problem: only a few bytes from a large object were stored
in the database. Then I downgraded to PHP 4.2 and the same script
works well on the same database.


I never had any problems with LOs on a php 4.3.x <--> Postrgresql system I was
working on last year. There must have been something else happening that isn't
attributable to use of LOs.
--
Nigel J. Andrews
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 22 '05 #5
I agree with Nigel, and I'll take a guess as to why you experienced this,
Conni. If Postgres was upgraded after PHP 4.3.x was installed and PHP
wasn't recompiled, PHP was working with an outdated Postgres client. When
you downgraded, you're recompile used the new client. You could have gotten
the same result just by recompiling the same version of PHP.
-----Original Message-----
From: pg*****************@postgresql.org
[mailto:pg*****************@postgresql.org]On Behalf Of Nigel J. Andrews
Sent: Wednesday, February 04, 2004 2:23 AM
To: Cornelia Boenigk
Cc: scott.marlowe; Tom Lane; Rens Admiraal; pg***********@postgresql.org
Subject: Re: [GENERAL] BLOB problem
On Wed, 4 Feb 2004, Cornelia Boenigk wrote:
Hello
I've encountered a problem with a PostgreSQL database


Are you sure that the problem is with PostgreSQL?

I was testing pg_lo_import() with PHP 4.3.x and found it buggy. I had
the opposite problem: only a few bytes from a large object were stored
in the database. Then I downgraded to PHP 4.2 and the same script
works well on the same database.


I never had any problems with LOs on a php 4.3.x <--> Postrgresql
system I was
working on last year. There must have been something else
happening that isn't
attributable to use of LOs.
--
Nigel J. Andrews


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 22 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: John | last post by:
I have over 5000 thumbnail pictures of size 5kb each. I would like to able to load all 5000 pictures and view 50 per page using mysql_data_seek(). I would like to know what are the advantages and...
2
by: Carolyn Longfoot | last post by:
Help! This is driving me crazy... I'm trying to read a BLOB from a db and display it in a browser, like so: $query="SELECT blob from table where blob_id=9"; $result=mysql_query($query);...
6
by: Juergen Gerner | last post by:
Hello Python fans, I'm trying and searching for many days for an acceptable solution... without success. I want to store files in a database using BLOB fields. The database table has an ID field...
0
by: Mark Fisher | last post by:
I cannot seem to store binary data as a BLOB. I used the following to create a table capable of holding a BLOB: CREATE TABLE blob_table ( id INT UNSIGNED NOT NULL AUTO_INCREMENT,...
6
by: Pierre-Benoit | last post by:
Hi there, I've a strange problem with ado.net and an Access db. I need to create a little C# app that take the content of "ole object" field and then save it into a file. The problem is that...
15
by: Daniel Schuchardt | last post by:
Hi @ all, i'm sure there was a psql-function to transfere my Blob-Data to the server but I can't remember. I have a script like this : UPDATE xy SET z = lo_import('localpath_and_file'); ...
1
by: Markusek Peter | last post by:
Hi, I'm using MySQLDriverCS. I've got no problem to store BLOB into database, but I can't get it back(save to file). Problem is with DataTable(returns string:( ) My code: -- DataTable dt = new...
2
by: pmz | last post by:
Dear Group, I'm connecting in C# with remote (BSD) MySQL server with ODBC Driver, and I'm trying to find the best sollution in such problem: As I've read on MySQL manual, they have suggested...
11
by: Peter Afonin | last post by:
Hello, I have Word documents stored in the Oracle database in the BLOB field that I need to retrieve. I've found the way of doing it: While dr.Read sName = dr("TE_PM_ATTACH_NAME") bLob =...
2
by: Vinciz | last post by:
hi guys... im new in java and i would love to learn some of these... basically i got a sample code to retrieve the blob from the mysql. however, i dont really know what to do with these...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.