Re: binary data storage

From: Denis Gasparin <denis(at)edistar(dot)com>
To: Martín Marqués <martin(at)bugs(dot)unl(dot)edu(dot)ar>
Cc: PostgreSQL Mailing Lists-General <pgsql-general(at)postgresql(dot)org>
Subject: Re: binary data storage
Date: 2002-04-04 14:32:44
Message-ID: 1017930765.2197.3.camel@edspctec12
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Martin,
I discourage you to use the large object data type for a file of such
dimensions... It would be better for you to store in the db the filename
and the path to the file itself.
However you can find the large object you've inserted in your data
directory (subdirectory base/oid of your database/).

Bye,
--
Doct. Eng. Denis Gasparin: denis(at)edistar(dot)com
---------------------------
Programmer & System Administrator - Edistar srl

Il gio, 2002-04-04 alle 14:07, Martín Marqués ha scritto:
> On Jue 04 Abr 2002 06:42, you wrote:
> > Hi Marin,
> >
> > On Thu, 4 Apr 2002, Marin Dimitrov wrote:
> > > search for "large objects" in the Programmer's Guide (
> > > http://www.ca.postgresql.org/users-lounge/docs/#7.2 )
> > >
> > > in your case Large Objects (chapter 2 from the Programmer's Guide) may be
> > > more appropriate than binary strings (chapter 3.4 from the User's Guide)
> >
> > Thanks alot. Also searched php manual and wrote the following simple code:
> >
> > <?
> > $conn = Pg_Connect (......);
> > pg_exec ($conn, "begin");
> > $oid = pg_locreate ($conn);
> > echo ("$oid\n");
> > $handle = pg_loopen ($conn, $oid, "w");
> > echo ("$handle\n");
> > pg_loimport ("/etc.tar.gz");
> > pg_lowrite ($handle, "/etc.tar.gz");
>
> This is something that confuses me:
> What does pg_loimport do, and what does pg_lowrite do?
>
> > pg_loclose ($handle);
> > pg_exec ($conn, "commit");
> > ?>
>
> Another question I have about using PHP and PostgreSQL Large Objects, is that
> in no place there is a reference to where the lo will be stored?
>
> I mean, where will /etc.tar.gz be stored in the Database?
>
> Saludos... :-)
>
> --
> Porqué usar una base de datos relacional cualquiera,
> si podés usar PostgreSQL?
> -----------------------------------------------------------------
> Martín Marqués | mmarques(at)unl(dot)edu(dot)ar
> Programador, Administrador, DBA | Centro de Telematica
> Universidad Nacional
> del Litoral
> -----------------------------------------------------------------
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Heiko Klein 2002-04-04 14:32:50 Re: [NOVICE] readline and psql
Previous Message Heiko Klein 2002-04-04 13:32:48 Re: hex values