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

From Durumdara
Subject Re: Remove default privilege from DB
Date
Msg-id CAEcMXhk8YVgiQSD4V9mnk6ex1FxSSxK_zx24SmrWR-fvUs3Ckg@mail.gmail.com
Whole thread Raw
In response to RE: Remove default privilege from DB  ("Charles Clavadetscher" <clavadetscher@swisspug.org>)
Responses Re: Remove default privilege from DB
List pgsql-general
Hello!

2018-02-15 14:19 GMT+01:00 Charles Clavadetscher <clavadetscher@swisspug.org>:

What version of PostgreSQL are you using?

And how did you get those first entries at all?

What happens if you issue

ALTER DEFAULT PRIVILEGES FOR ROLE suser GRANT EXECUTE ON FUNCTIONS TO PUBLIC;

again?


After that:
24629;0;"S";"{}"
24629;0;"T";"{}"
24629;0;"r";"{}"
24629;0;"f";"{=X/suser}"

ALTER DEFAULT PRIVILEGES FOR ROLE suser revoke EXECUTE ON FUNCTIONS from PUBLIC;

24629;0;"S";"{}"
24629;0;"T";"{}"
24629;0;"r";"{}"
24629;0;"f";"{}"

PGSQL 9.4, 9.6 on Debian (diff. servers).

The source of the problem would be complicated.

The suser is not superuser, but all db owner was member of him. 

The databases sometimes created from template0, sometimes copied from prev. basic database (create database from another database), or from backup/restore.
We created suser to see every data in database. But objects are created by him denied from db owner.
Because of that we added default privileges (suser -> db owner).
The time passed away and many things changes. So we want to remove def. privileges, but these orphan records remain here.
I removed  the actual DB owner from suser's member list, but it have no effect.

I will try to make backup/restore on an example db to see what happen. I will try to recreate this strange thing in my test server.

Thanks
 dd

 

pgsql-general by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: strange construct with RETURN within plpgsql
Next
From: Pavel Stehule
Date:
Subject: Re: Dynamic PL/pgSQL select query: value association propblem