Re: Permission denied when inserting

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org, borek(at)lupomesky(dot)cz
Subject: Re: Permission denied when inserting
Date: 2011-02-28 15:38:39
Message-ID: 201102280738.40122.adrian.klaver@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Monday, February 28, 2011 6:37:51 am Borek Lupomesky wrote:
> Hello,
>
> I have a database app that worked fine until we reinstalled the
> server with the related DB dump and restore. Most of the stuff works
> fine after the reinstall, but one particular insert gives very cryptic
> (for me) message:
>
> spam=> INSERT INTO permout ( site, cp, owner, descr, creat_who ) VALUES
> ( 'vin', '3035.1', 'borelupo', 'test', 'borelupo' );
> ERROR: permission denied for relation out2cp
> CONTEXT: SQL statement "SELECT 1 FROM ONLY "public"."out2cp" x WHERE
> "site"::pg_catalog.text OPERATOR(pg_catalog.=) $1::pg_catalog.text AND
> "cp"::pg_catalog.text OPERATOR(pg_catalog.=) $2::pg_catalog.text FOR
> SHARE OF x"
>
> Note, that I am inserting into table "permout", but the message is
> about permission for "out2cp". Any idea what went wrong? When I was
> doing the dump I forgot to dump all the permissions as well so I had to
> restore them manually and possibly something is not right somewhere, but
> the error message given is of no help to me. What does the "CONTEXT"
> message actually mean?
> More information is below (I'm logged in as user 'borelupo').

Just to be clear where you borelupo when you ran the above statement?
Also what do:
SELECT current_user;
SELECT session_user;

show when you are logged in?

--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2011-02-28 15:41:40 Re: NullPointerException when making a getCapabilities request
Previous Message Arturo Perez 2011-02-28 15:37:38 FTS and words near one another