Add usebypassrls to pg_user and pg_shadow
authorStephen Frost <[email protected]>
Thu, 29 Jan 2015 02:47:15 +0000 (21:47 -0500)
committerStephen Frost <[email protected]>
Thu, 29 Jan 2015 02:47:15 +0000 (21:47 -0500)
The row level security patches didn't add the 'usebypassrls' columns to
the pg_user and pg_shadow views on the belief that they were deprecated,
but we havn't actually said they are and therefore we should include it.

This patch corrects that, adds missing documentation for rolbypassrls
into the system catalog page for pg_authid, along with the entries for
pg_user and pg_shadow, and cleans up a few other uses of 'row-level'
cases to be 'row level' in the docs.

Pointed out by Amit Kapila.

Catalog version bump due to system view changes.

doc/src/sgml/catalogs.sgml
src/backend/catalog/system_views.sql
src/include/catalog/catversion.h
src/test/regress/expected/rules.out

index 62305d2bb3ec17b08d7794d4798d5d399279bb0f..49891a4a7bf576537d1fb2bb903b223af4fb614b 100644 (file)
       </entry>
      </row>
 
+     <row>
+      <entry><structfield>rolbypassrls</structfield></entry>
+      <entry><type>bool</type></entry>
+      <entry>
+       Role can bypass row level security policies, see
+       <xref linkend="ddl-rowsecurity"> for more information.
+      </entry>
+     </row>
+
      <row>
       <entry><structfield>rolconnlimit</structfield></entry>
       <entry><type>int4</type></entry>
       <entry><type>bool</type></entry>
       <entry></entry>
       <entry>
-       True if table has row-level security enabled; see
+       True if table has row level security enabled; see
        <link linkend="catalog-pg-policy"><structname>pg_policy</structname></link> catalog
       </entry>
      </row>
   </indexterm>
 
   <para>
-   The catalog <structname>pg_policy</structname> stores row-level
+   The catalog <structname>pg_policy</structname> stores row level
    security policies for tables.  A policy includes the kind of
    command that it applies to (possibly all commands), the roles that it
    applies to, the expression to be added as a security-barrier
@@ -9030,6 +9039,16 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
       </entry>
      </row>
 
+     <row>
+      <entry><structfield>usebypassrls</structfield></entry>
+      <entry><type>bool</type></entry>
+      <entry></entry>
+      <entry>
+       User can bypass row level security policies, see
+       <xref linkend="ddl-rowsecurity"> for more information.
+      </entry>
+     </row>
+
      <row>
       <entry><structfield>passwd</structfield></entry>
       <entry><type>text</type></entry>
@@ -9505,6 +9524,16 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
       </entry>
      </row>
 
+     <row>
+      <entry><structfield>usebypassrls</structfield></entry>
+      <entry><type>bool</type></entry>
+      <entry></entry>
+      <entry>
+       User can bypass row level security policies, see
+       <xref linkend="ddl-rowsecurity"> for more information.
+      </entry>
+     </row>
+
      <row>
       <entry><structfield>passwd</structfield></entry>
       <entry><type>text</type></entry>
index 6df6bf27d191bf1aff41f99d4b3dddf436855c92..5e69e2b2addfcc89b6e1b416987e799a9f6a184f 100644 (file)
@@ -33,6 +33,7 @@ CREATE VIEW pg_shadow AS
         rolsuper AS usesuper,
         rolcatupdate AS usecatupd,
         rolreplication AS userepl,
+        rolbypassrls AS usebypassrls,
         rolpassword AS passwd,
         rolvaliduntil::abstime AS valuntil,
         setconfig AS useconfig
@@ -58,6 +59,7 @@ CREATE VIEW pg_user AS
         usesuper,
         usecatupd,
         userepl,
+        usebypassrls,
         '********'::text as passwd,
         valuntil,
         useconfig
index 13c4376b8cc6ced155bb3b14af36276faa962c57..2b7a0bb93bc67fedf5233c987705b183f2df9f82 100644 (file)
@@ -53,6 +53,6 @@
  */
 
 /*                         yyyymmddN */
-#define CATALOG_VERSION_NO 201501241
+#define CATALOG_VERSION_NO 201501281
 
 #endif
index 7df5d2dce9a5d27ca75bb2248031c788b05e9a1a..d50b103f159cb52a89b158bc173a59c5078eeb8d 100644 (file)
@@ -1609,6 +1609,7 @@ pg_shadow| SELECT pg_authid.rolname AS usename,
     pg_authid.rolsuper AS usesuper,
     pg_authid.rolcatupdate AS usecatupd,
     pg_authid.rolreplication AS userepl,
+    pg_authid.rolbypassrls AS usebypassrls,
     pg_authid.rolpassword AS passwd,
     (pg_authid.rolvaliduntil)::abstime AS valuntil,
     s.setconfig AS useconfig
@@ -2063,6 +2064,7 @@ pg_user| SELECT pg_shadow.usename,
     pg_shadow.usesuper,
     pg_shadow.usecatupd,
     pg_shadow.userepl,
+    pg_shadow.usebypassrls,
     '********'::text AS passwd,
     pg_shadow.valuntil,
     pg_shadow.useconfig