PUBLIC Role

By default, every database has the special PUBLIC role. Vertica grants this role to each user automatically, and it is automatically enabled. You grant privileges to this role that every user should have by default. You can also grant access to roles to PUBLIC, which allows any user to access the role using the SET ROLE statement.

Note: The PUBLIC role can never be dropped, nor can it be revoked from users or roles.

Privileges created using the WITH GRANT OPTION cannot be granted to a Public Role:

=> CREATE TABLE t1(a int);
CREATE TABLE
=> GRANT SELECT on t1 to PUBLIC with grant option;
ROLLBACK 3484: Grant option for a privilege cannot be granted to "public"

For more information see How to Grant Privileges.

Example

In the following example, if the superuser hadn't granted INSERT privileges on the table publicdata to the PUBLIC group, the INSERT statement executed by user bob would fail:

=> CREATE TABLE publicdata (a INT, b VARCHAR);
CREATE TABLE
=> GRANT INSERT, SELECT ON publicdata TO PUBLIC;
GRANT PRIVILEGE
=> CREATE PROJECTION publicdataproj AS (SELECT * FROM publicdata);
CREATE PROJECTION

dbadmin=> \c - bob
You are now connected as user "bob".

=> INSERT INTO publicdata VALUES (10, 'Hello World');
OUTPUT
--------
      1
(1 row)

See Also

PUBLIC User