Re: lo wrappers - still working on it - Mailing list pgsql-general

From Scott Holmes
Subject Re: lo wrappers - still working on it
Date
Msg-id 200107041440.HAA01273@scotts.mynetwork.net
Whole thread Raw
In response to Re: lo wrappers - still working on it  ("Eric G. Miller" <egm2@jps.net>)
Responses Re: Re: lo wrappers - still working on it  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
> 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'));
>

I tried this initially, it results in an error and the following warning:

You must have Postgres superuser privilege to use server-side lo_export().
Anyone can use the client-side lo_export provided by libpq.

PostgreSQL has not been installed on any of the client computers and I would
much rather retain the function in an SQL statement capability for this.

> Someone recently suggested using bytea fields for blobs as well...
>
> --
> Eric G. Miller <egm2@jps.net>
>

I've been considering bytea, however, I do have some parallel development on
PHP 4 using lo's that work just fine.  I have not tried re-writing this stuff
with bytea.  The two separate systems do need to utilize the same database.



pgsql-general by date:

Previous
From: "Andras Balogh"
Date:
Subject: FOREIGN KEY
Next
From: Alex Pilosov
Date:
Subject: Re: ERROR: fmgr_info: function 0: cache lookup failed