Re: [GENERAL] [SQL] Can I store bitmap graphics in a table?

From: Matt McClure <matthew(dot)mcclure(at)yale(dot)edu>
To: Dan Delaney <dionysos(at)dionysia(dot)org>
Cc: PostgreSQL General List <pgsql-general(at)postgreSQL(dot)org>
Subject: Re: [GENERAL] [SQL] Can I store bitmap graphics in a table?
Date: 1998-07-21 14:30:36
Message-ID: Pine.GSO.3.94.980721102222.18672G-100000@mercury.cis.yale.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'm relatively new to postgres myself, but I'll take a stab at this.
Anyone can feel free to correct me if I'm wrong.

You can insert the graphic file by declaring the type to be OID and using
lo_import().

For example:

create table graphics
(name text, graphic oid);

insert into graphics values ('pic1', lo_import ('gif1.gif'));

Check out the manpage for large_objects for more info.

BTW, does anyone know, once I create a large object, and it creates the
files xinv... and xinx..., how I can get rid of postgres's references to
these objects when I no longer need them. (vacuum gives a notice that it
can't remove these even if I have physically removed the files from the
database's directory).

-Matt

On Tue, 21 Jul 1998, Dan Delaney wrote:

> Hello all,
> Can a bitmap graphic file (say a GIF, JPEG, or EPS) be stored
> into a PostgreSQL table? If so, how? What field type should I set up
> in the table and how do I insert the graphic file?
> Thanks.
> --Dan
>
> -----------------------------------------------------------------------
> Daniel G. Delaney The Louisville Times Chorus
> Dionysos(at)Dionysia(dot)org www.LouisvilleTimes.org
> www.Dionysia.org/~dionysos/ Dionysia Design
> ICQ Number: 8171285 www.Dionysia.com/design/
> -----------------------------------------------------------------------
> I doubt, therefore I might be.
>
>
>
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 1998-07-21 14:58:52 Re: [HACKERS] [Fwd: SGVLLUG Oracle and Informix on Linux]
Previous Message Herve Lefebvre 1998-07-21 14:19:35 [GENERAL][SQL] Functions with composite resutl-set