Re: Drop Default Privileges?

From: Fabio Pardi <f(dot)pardi(at)portavita(dot)eu>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Drop Default Privileges?
Date: 2018-06-19 15:38:28
Message-ID: 8dd0353c-2044-fe7d-13c6-df43563ede1b@portavita.eu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Louis,

I think 'alter user' can do the job for you.

https://www.postgresql.org/docs/current/static/sql-alteruser.html

Else, as alternative: before running pg_restore, you couldedit the dump and replace the string 'ROLE postgres' withthe correct useron the RDS instance.

regards,

fabio pardi

On 19/06/18 17:20, Louis Battuello wrote:
> Is it possible to drop default privileges?
>
> I’m attempting to run a pg_restore into an RDS instance, which doesn’t have a “postgres” user.
>
> I encounter many messages like so:
>
> ALTER DEFAULT PRIVILEGES...
>
> pg_restore: [archiver (db)] Error from TOC entry 10182; 826 253752252 <tel:826%20253752252> DEFAULT ACL DEFAULT PRIVILEGES FOR TABLES postgres
>
> pg_restore: [archiver (db)] could not execute query: ERROR:  role "postgres" does not exist
>
>     Command was: ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA abc_schema REVOKE ALL ON TABLES  FROM PUBLIC;
>
>
> I’d like to remove these default privileges on the source database to avoid this error message, but I can’t find the syntax in the documentation (or if it’s possible). I only see GRANT/REVOKE options.
>
> Thanks,
> Louis

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sherrylyn Branchaw 2018-06-19 15:43:25 Re: What to do when dynamic shared memory control segment is corrupt
Previous Message David G. Johnston 2018-06-19 15:37:17 Re: Drop Default Privileges?