Thread

  1. BLOB problem

    Rens Admiraal <postgresnews@etraned.nl> — 2004-02-03T11:24:39Z

    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
    
  2. Re: BLOB problem

    Tom Lane <tgl@sss.pgh.pa.us> — 2004-02-03T23:31:15Z

    Rens Admiraal <postgresnews@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
    
    
  3. Re: BLOB problem

    scott.marlowe <scott.marlowe@ihs.com> — 2004-02-04T00:09:19Z

    On Tue, 3 Feb 2004, Tom Lane wrote:
    
    > Rens Admiraal <postgresnews@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.
    
    
    
    
    
  4. Re: BLOB problem

    Cornelia Boenigk <poppcorn@cornelia-boenigk.de> — 2004-02-04T02:31:48Z

    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
    
    
    
  5. Re: BLOB problem

    Nigel J. Andrews <nandrews@investsystems.co.uk> — 2004-02-04T07:23:29Z

    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
    
    
    
  6. Re: BLOB problem

    Rod Kreisler <rod@23net.net> — 2004-02-04T11:58:03Z

    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: pgsql-general-owner@postgresql.org
    > [mailto:pgsql-general-owner@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; pgsql-general@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