From: | "Eric G(dot) Miller" <egm2(at)jps(dot)net> |
---|---|
To: | PG-General <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: lo wrappers - still working on it |
Date: | 2001-07-04 04:25:07 |
Message-ID: | 20010703212507.A6240@calico.local |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Tue, Jul 03, 2001 at 08:56:20PM -0700, Scott Holmes wrote:
> Perhaps someone can point me towards what I'm missing. I've included my make
> command, the command for creating a function and the actual code I wrote
> (derived from the sample code in the docs). Incidentally, this project is too
> far along to change to java or any other interface. I currently am handling
> the files to be lo's as system files but the request is in to save them as
> blobs.
You've written a client-side program, but are trying to use it as a
server side function. I don't think that'll work. You don't want to be
using libpq for server side functions. I don't know the Java interface, but
it seems you are trying to do what is already available via
lo_import/lo_export functions. Maybe you could explain the interface
you need a little better. Is it not possible to use the lo_import() and
lo_export functions that are already available? (Why they are hidden in
the Programmer's Guide is beyond me...).
SELECT lo_export (<table>.<column>, '/path/to/file') from <table>;
INSERT INTO <table> (<column>) VALUES (lo_import ('/path/to/file'));
Someone recently suggested using bytea fields for blobs as well...
--
Eric G. Miller <egm2(at)jps(dot)net>
From | Date | Subject | |
---|---|---|---|
Next Message | Andy Samuel | 2001-07-04 04:58:11 | Re: Red Hat Database Development |
Previous Message | Scott Holmes | 2001-07-04 03:56:20 | lo wrappers - still working on it |