Re: JPEG Files In Postgres Database - Mailing list pgsql-general

From sobrien@id.jefferson.co.us ()
Subject Re: JPEG Files In Postgres Database
Date
Msg-id 7g2dq7$iop$1@news-2.csn.net
Whole thread Raw
In response to JPEG Files In Postgres Database  ("Rick Bourassa" <rickb@networxtech.com>)
List pgsql-general
Rick Bourassa (rickb@networxtech.com) wrote:
: Can anyone tell me how to store jpeg fies in a Postgres table?  What field
: type to use?

: I am doing some develpment with VB and ODBC.

Rick:  I have had really good luck with the following:

create table pix (sch char(6), picture oid) archive=none;
grant select on pix to public;
insert into pix (sch, picture)
  values ('001', lo_import('/home/sobrien/pix/knight.jpg'));
insert into pix (sch, picture)
  values ('002', lo_import('/home/sobrien/pix/parrot.jpg'));
insert into pix (sch, picture)
  values ('003', lo_import('/home/sobrien/pix/penguin.jpg'));
insert into pix (sch, picture)
  values ('004', lo_import('/home/sobrien/pix/raccoon.jpg'));
insert into pix (sch, picture)
  values ('005', lo_import('/home/sobrien/pix/rose.jpg'));
insert into pix (sch, picture)
  values ('006', lo_import('/home/sobrien/pix/rundog.jpg'));
insert into pix (sch, picture)
  values ('007', lo_import('/home/sobrien/pix/snail.jpg'));
insert into pix (sch, picture)
  values ('008', lo_import('/home/sobrien/pix/spider.jpg'));
insert into pix (sch, picture)
  values ('009', lo_import('/home/sobrien/pix/stork.jpg'));
insert into pix (sch, picture)
  values ('010', lo_import('/home/sobrien/pix/tulip.jpg'));

Good Luck,
Steve


pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [GENERAL] advice on buying sun hardware to run postgres
Next
From: Jim Jennis
Date:
Subject: Re: [GENERAL] advice on buying sun hardware to run postgres