Today I have tried to dump my PgSQL database, something I do from time to time without any trouble, but it failed:
borelupo@l5nets02:~$ pg_dump -f spam-20150123.sql -F p -O -C -h x.x.x.x -U borelupo spam
Password:
pg_dump: SQL command failed
pg_dump: Error message from server: ERROR: permission denied for relation badports
pg_dump: The command was: LOCK TABLE public.badports IN ACCESS SHARE MODE
Now, the user borelupo is owner of the table, how can he get permission denied at all?
spam=> \d
List of relations
Schema | Name | Type | Owner
-------+---------------+-------+----------
public | badports | table | borelupo
What gives? PostgreSQL is 9.1.14.
Edit: When I connect as admin user (postgres), the dumps works OK. But I'd surely like not needing to login into db server, switch users etc.
-U borelupoto-U postgres- Vivek S.