Re: Remove default privilege from DB

From: Durumdara <durumdara(at)gmail(dot)com>
To: Charles Clavadetscher <clavadetscher(at)swisspug(dot)org>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Remove default privilege from DB
Date: 2018-02-16 14:56:58
Message-ID: CAEcMXhnh1sOz10U3-bDFMmCYgmfC6sCQiK4zy-z7oBJMQBmmZQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dear Charles!

I did search on backup SQL, and I found 4 lines. All of them needed. I
reversed them (Revoke to Grant):

ALTER DEFAULT PRIVILEGES FOR ROLE suser grant ALL ON TYPES to PUBLIC;
ALTER DEFAULT PRIVILEGES FOR ROLE suser grant ALL ON TYPES to suser;

ALTER DEFAULT PRIVILEGES FOR ROLE suser grant ALL ON functions to PUBLIC;
ALTER DEFAULT PRIVILEGES FOR ROLE suser grant ALL ON functions to suser;

And then all lines gone from query, and from "\ddp".

Ok, it's done.

But the question is: WHY?

When I tried to do same thing but only with one line:

This:
ALTER DEFAULT PRIVILEGES FOR ROLE suser grant ALL ON TYPES to PUBLIC;
Or just this:
ALTER DEFAULT PRIVILEGES FOR ROLE suser grant ALL ON TYPES to suser;

The result was wrong.

I want to know what happened in the background.
I will make "negative" state if I revoke DefACL without prior grant?

Thank you!

dd

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2018-02-16 15:18:21 Re: Remove default privilege from DB
Previous Message Pavel Stehule 2018-02-16 14:43:32 Re: strange construct with RETURN within plpgsql