From: Hilbert, Karin <ioh1@psu.edu>
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: ALTER DEFAULT PRIVILEGES FOR ROLE
Date: Wed, 30 Jan 2019 18:57:08 +0000
Message-ID: <DM6PR02MB48761279ADE0CD89EF417E4189900@DM6PR02MB4876.namprd02.prod.outlook.com> (raw)
After a database was updated by the application, a schema dump showed the following default privilege statements:
--
-- Name: DEFAULT PRIVILEGES FOR SEQUENCES; Type: DEFAULT ACL; Schema: public; Owner: gitlab_dbo
--
ALTER DEFAULT PRIVILEGES FOR ROLE <dbowner> IN SCHEMA public REVOKE ALL ON SEQUENCES FROM <dbowner>;
ALTER DEFAULT PRIVILEGES FOR ROLE <dbowner> IN SCHEMA public GRANT SELECT,USAGE ON SEQUENCES TO <appuser>;
--
-- Name: DEFAULT PRIVILEGES FOR TABLES; Type: DEFAULT ACL; Schema: public; Owner: <dbowner>
--
ALTER DEFAULT PRIVILEGES FOR ROLE <dbowner> IN SCHEMA public REVOKE ALL ON TABLES FROM <dbowner>;
ALTER DEFAULT PRIVILEGES FOR ROLE <dbowner> IN SCHEMA public GRANT SELECT,INSERT,DELETE,UPDATE ON TABLES TO <appuser>;
Why would you want to revoke all privileges from the dbowner?
It actually had granted the privileges to PUBLIC, but I revoked those privileges & changed it to the app account.
What is the difference between these statements?:
ALTER DEFAULT PRIVILEGES FOR ROLE <dbowner> IN SCHEMA public GRANT ... TO <appuser>;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ... TO <appuser>;
Karin Hilbert
Database Specialist
Administrative Information Services
Pennsylvania State University
25 Shields Bldg., University Park, PA 16802
Work - 814-863-3633
Email - ioh1@psu.edu
IM - ioh1@chat.psu.edu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: ioh1@psu.edu
Subject: Re: ALTER DEFAULT PRIVILEGES FOR ROLE
In-Reply-To: <DM6PR02MB48761279ADE0CD89EF417E4189900@DM6PR02MB4876.namprd02.prod.outlook.com>
References: <DM6PR02MB48761279ADE0CD89EF417E4189900@DM6PR02MB4876.namprd02.prod.outlook.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox