Re: psql lo_export documentation

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Jorgen Austvik - Sun Norway *EXTERN*" <Jorgen(dot)Austvik(at)Sun(dot)COM>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: psql lo_export documentation
Date: 2007-11-30 14:26:29
Message-ID: D960CB61B694CF459DCFB4B0128514C2A0B15D@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jorgen Austvik wrote:
>
> The 8.3 psql documentation says this about lo_export:
>
[...]
> <term><literal>\lo_export <replaceable
[...]
> Note that this is subtly different from the server function
> <function>lo_export</function>, which acts with the permissions
> of the user that the database server runs as and on the server's
> file system.

> Below is an error message I get when I try to use lo_export
> from client:
>
> other_database=> SELECT lo_export(16391, '/tmp/file') FROM
> lotest_stash_values;
> ERROR: must be superuser to use server-side lo_export()
> HINT: Anyone can use the client-side lo_export() provided by libpq.
>
> With experiments I find that lo_export on 8.3 stores the files on the
> database server file system. I also think it would be good if the
> documentation said that you need to be database superuser to use this

I think you are confusing lo_export(), the server function,
and \lo_export, the psql command.

See the documentation you quoted above and also
http://www.postgresql.org/docs/8.2/static/lo-funcs.html

The function writes to a file on the database server, while the
psql command writes to a file on the database client.

The behaviour has not changed in 8.3, as far as I know.

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Childs 2007-11-30 14:33:07 Re: postgresql table inheritance
Previous Message Cedric Boudin 2007-11-30 14:26:02 scrollable cursor in functions