Re: Remove default privilege from DB - Mailing list pgsql-general

From Durumdara
Subject Re: Remove default privilege from DB
Date
Msg-id CAEcMXhnh1sOz10U3-bDFMmCYgmfC6sCQiK4zy-z7oBJMQBmmZQ@mail.gmail.com
Whole thread Raw
In response to Re: Remove default privilege from DB  (Durumdara <durumdara@gmail.com>)
Responses Re: Remove default privilege from DB
List 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

pgsql-general by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: strange construct with RETURN within plpgsql
Next
From: "David G. Johnston"
Date:
Subject: Re: Remove default privilege from DB