PUBLIC is a reserved keyword that represents a built-in, always-present role containing every current and future login on the database cluster or instance. Because every user automatically belongs to PUBLIC, privileges granted to PUBLIC are inherited by all users without the need to enumerate them individually. PUBLIC can appear anywhere a role name is accepted in privilege statements, synonyms, or object ownership (depending on the dialect). Revoking from PUBLIC removes the privilege from everyone unless it is re-granted directly or via another role. The keyword does not create a real role object you can drop or rename; it exists implicitly and permanently. Careless grants to PUBLIC can unintentionally expose data or functionality to all users, so least-privilege practices recommend minimal PUBLIC rights beyond CONNECT or USAGE where required.
GRANT, REVOKE, ROLE, PRIVILEGE, SECURITY, DEFAULT PRIVILEGES
SQL-92 standard (GRANT/REVOKE syntax)
PUBLIC is a built-in role that every database user belongs to automatically. Grants to PUBLIC apply to all users without listing them individually.
It depends on the privilege. Read-only access to harmless lookup tables is usually fine. Granting write, delete, or administrative rights to PUBLIC can expose critical data or bypass security controls.
No. PUBLIC is hard-coded in the database system. You can only control which privileges it holds, not its existence or name.
Query the system catalogs for privileges where grantee = 'PUBLIC' (PostgreSQL) or use each dialect's metadata views to list PUBLIC grants.