Thread: cannot do backup - locked?

cannot do backup - locked?

From
Anne Wainwright
Date:
Hi

I have previously done my backups in these ways, but now we get 'locked'
messages.

pandora@jason:~$  pg_dump -C -f fables_back_20130916.sql Fables
pg_dump: SQL command failed
pg_dump: Error message from server: ERROR:  permission denied for
relation books
pg_dump: The command was: LOCK TABLE public.books IN ACCESS SHARE MODE



pandora@jason:~$ pg_dump -a  -f fables_data_20130916.sql Fables
pg_dump: SQL command failed
pg_dump: Error message from server: ERROR:  permission denied for
relation books
pg_dump: The command was: LOCK TABLE public.books IN ACCESS SHARE MODE

(this second command used a -d flag, but this looks like it has been
changed to --inserts ??

whatever, what is happening here? I clearly have files created by these
commands, but dated a long time back, in the postgres user account.

Anne


Re: cannot do backup - locked?

From
Lonni J Friedman
Date:
This looks potentially appropriate:
http://www.postgresql.org/message-id/349.1146881338@sss.pgh.pa.us
http://stackoverflow.com/questions/4363697/copy-a-postgres-database-without-lock-permissions

Neither of your commands specify a username to connect as. I'd suggest
using the -U option with a user who can access the database in
question.

On Sun, Sep 15, 2013 at 5:03 PM, Anne Wainwright
<anotheranne@fables.co.za> wrote:
> Hi
>
> I have previously done my backups in these ways, but now we get 'locked'
> messages.
>
> pandora@jason:~$  pg_dump -C -f fables_back_20130916.sql Fables
> pg_dump: SQL command failed
> pg_dump: Error message from server: ERROR:  permission denied for
> relation books
> pg_dump: The command was: LOCK TABLE public.books IN ACCESS SHARE MODE
>
>
>
> pandora@jason:~$ pg_dump -a  -f fables_data_20130916.sql Fables
> pg_dump: SQL command failed
> pg_dump: Error message from server: ERROR:  permission denied for
> relation books
> pg_dump: The command was: LOCK TABLE public.books IN ACCESS SHARE MODE
>
> (this second command used a -d flag, but this looks like it has been
> changed to --inserts ??
>
> whatever, what is happening here? I clearly have files created by these
> commands, but dated a long time back, in the postgres user account.
>
> Anne
>
>
> --
> Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-novice



--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
L. Friedman                                    netllama@gmail.com
LlamaLand                       https://netllama.linux-sxs.org


Re: cannot do backup - locked?

From
Anne Wainwright
Date:
Lonni,

Yes, I fell into the  trap, it was not a lock it was a permission issue,
probably because I changed something that I shouldn't have at some stage
in the past.

I have on this server a user account 'postgres', if I log in there and run
these commands then all goes well. I do not have to use the -U flag
even.

Now I may have changed something at some stage, but if I am logged in to
user account 'pandora', then even when using the -U flag, using username
'postgres' and giving the correct password, I still get permission
errors. 'postgres' must have permissions on the table, and probably
'pandora' doesn't any more, but I don't understand why I cannot run the
backup command as user 'postgres' from the 'pandora' account as of old.

I am obviously confused as to the relation between user accounts and
postgresql accounts. Where should I look to understand and correct this.

Thank you for your time.

Anne

On Sun, Sep 15, 2013 at 05:28:36PM -0700, Lonni J Friedman wrote:
> This looks potentially appropriate:
> http://www.postgresql.org/message-id/349.1146881338@sss.pgh.pa.us
> http://stackoverflow.com/questions/4363697/copy-a-postgres-database-without-lock-permissions
>
> Neither of your commands specify a username to connect as. I'd suggest
> using the -U option with a user who can access the database in
> question.
>
> On Sun, Sep 15, 2013 at 5:03 PM, Anne Wainwright
> <anotheranne@fables.co.za> wrote:
> > Hi
> >
> > I have previously done my backups in these ways, but now we get 'locked'
> > messages.
> >
> > pandora@jason:~$  pg_dump -C -f fables_back_20130916.sql Fables
> > pg_dump: SQL command failed
> > pg_dump: Error message from server: ERROR:  permission denied for
> > relation books
> > pg_dump: The command was: LOCK TABLE public.books IN ACCESS SHARE MODE
> >
> >
> >
> > pandora@jason:~$ pg_dump -a  -f fables_data_20130916.sql Fables
> > pg_dump: SQL command failed
> > pg_dump: Error message from server: ERROR:  permission denied for
> > relation books
> > pg_dump: The command was: LOCK TABLE public.books IN ACCESS SHARE MODE
> >
> > (this second command used a -d flag, but this looks like it has been
> > changed to --inserts ??
> >
> > whatever, what is happening here? I clearly have files created by these
> > commands, but dated a long time back, in the postgres user account.
> >
> > Anne
> >
> >
> > --
> > Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
> > To make changes to your subscription:
> > http://www.postgresql.org/mailpref/pgsql-novice
>
>
>
> --
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> L. Friedman                                    netllama@gmail.com
> LlamaLand                       https://netllama.linux-sxs.org
>
>
> --
> Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-novice