Re: Use PSQLFS for photo storage - Mailing list pgsql-general

From Sam Mason
Subject Re: Use PSQLFS for photo storage
Date
Msg-id 20090114005642.GO3008@frubble.xen.chris-lamb.co.uk
Whole thread Raw
In response to Re: Use PSQLFS for photo storage  (Jason Long <mailing.list@supernovasoftware.com>)
Responses Re: Use PSQLFS for photo storage
List pgsql-general
On Tue, Jan 13, 2009 at 06:43:06PM -0600, Jason Long wrote:
> Sam Mason wrote:
> >If you're OK with using large objects, instead of "bytea"s, you can use
> >the lo_import function.
>
> *They are on the server.  I would rather use bytea.  Is it possible to
> import them as large objects and then use SQL to convert them to bytea?*

You can, but it's pretty backward.  If you Java you'd probably be better
off using it to slurp in the file and do the insert there.  If you
really want to use large objects to go to byteas have a look through the
client side API[1] and then at the functions available to call from SQL
by doing \df from psql as they mirror the client calls very closely.

Be aware that you'll be creating a lot more "garbage" that PG will have
to clean out, so importing many gigabytes of data this way will take
much longer.


  Sam

pgsql-general by date:

Previous
From: Jason Long
Date:
Subject: Re: Use PSQLFS for photo storage
Next
From: Sam Mason
Date:
Subject: Re: Use PSQLFS for photo storage