Thread: \lo_unlink results in "ERROR: pg_description: Permission denied."

\lo_unlink results in "ERROR: pg_description: Permission denied."

From
Steven Mooij
Date:
After I've imported a huge file (1.3 GB) with "\lo_import", listed it with
"\lo_list" and tried to delete it with "\lo_unlink", I get the error:
"ERROR:  pg_description: Permission denied.".

I couldn't find anything in the documentation about large objects and their
expected behaviour, but I expected the lo to be deleted instead of this
error. The version of postgresql I use:
PostgreSQL 7.1 on i686-pc-linux-gnu, compiled by GCC 2.95.4

It is installed using the debian installation package postgres (
7.1release-4). Only I changed the data-directory (copied all files to
/home/postgres and created a softlink from /var/lib/postgres to
/home/postgres, while postgresql was not running.)

For me this was only a testdatabase, so for me it is not an urgent problem,
but I hope this can be solved.

Steven.

----------------------------------------
Steven Mooij
Kavezet Automatisering
Korvezeestraat 37
2628DB Delft

Telefoon:    +31 6 44960226
Email:        steven.mooij@kavezet.com
ICQ:        63799400

Re: \lo_unlink results in "ERROR: pg_description: Permission denied."

From
Tom Lane
Date:
Steven Mooij <steven.mooij@kavezet.com> writes:
> After I've imported a huge file (1.3 GB) with "\lo_import", listed it with
> "\lo_list" and tried to delete it with "\lo_unlink", I get the error:
> "ERROR:  pg_description: Permission denied.".

Yeah, this is a known bug.  You can do the delete as superuser ...

Peter, what do you think of hacking psql to only try the pg_description
actions if pset.issuper?  The alternative is to invent COMMENT ON LARGE
OBJECT, which is more work than I have time for at the moment.

            regards, tom lane

Re: \lo_unlink results in "ERROR: pg_description: Permission

From
Peter Eisentraut
Date:
Tom Lane writes:

> Peter, what do you think of hacking psql to only try the pg_description
> actions if pset.issuper?  The alternative is to invent COMMENT ON LARGE
> OBJECT, which is more work than I have time for at the moment.

Sounds reasonable.

--
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter