Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Grants in PostgreSQL are not recursive; a <code>GRANT</code> on the database sets rights to the database object but does not affect the contained schemas or their tables, views, functions, etc.</p> <p>Granting <code>ALL PRIVELEGES</code> on the database grants <code>CREATE</code>, <code>CONNECT</code> and <code>TEMPORARY</code> rights.</p> <p>See <code>\h GRANT</code> in psql, or <a href="http://www.postgresql.org/docs/8.4/static/sql-grant.html" rel="nofollow">the documentation for <code>GRANT</code> in 8.4</a>, to see what <code>ALL PRIVILEGES</code> means for <code>DATABASE</code>:</p> <pre><code>GRANT { { CREATE | CONNECT | TEMPORARY | TEMP } [, ...] | ALL [ PRIVILEGES ] } ON DATABASE database_name [, ...] TO { [ GROUP ] role_name | PUBLIC } [, ...] [ WITH GRANT OPTION ] </code></pre> <p>There are plpgsql functions and various 3rd party scripts available that use <code>pg_catalog</code> or <code>information_schema</code> to dynamically build <code>GRANT</code>s and recursively set rights. Search for "postgresql recursive grant". </p> <p>These will not help you set default access rights for <em>new</em> tables. PostgreSQL doe have <a href="http://www.postgresql.org/docs/current/static/sql-alterdefaultprivileges.html" rel="nofollow">ALTER DEFAULT PRIVILEGES</a> to allow you to set the default table rights for new tables, but it's only supported in Pg 9.1 and newer. Explicit <code>GRANT</code>s are required for each table in older versions or when permissions are to be set after table creation.</p> <p>Newer versions, as you noted, have facilities for multiple grants via <a href="http://www.postgresql.org/docs/current/static/sql-grant.html" rel="nofollow"><code>GRANT ... ALL TABLES</code></a>, but your question is specific to 8.4.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload