From 78d72563ef141ddc507ddd5ae77db613a309041a Mon Sep 17 00:00:00 2001 From: Stephen Frost Date: Fri, 3 Oct 2014 16:31:53 -0400 Subject: Fix CreatePolicy, pg_dump -v; psql and doc updates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Peter G pointed out that valgrind was, rightfully, complaining about CreatePolicy() ending up copying beyond the end of the parsed policy name. Name is a fixed-size type and we need to use namein (through DirectFunctionCall1()) to flush out the entire array before we pass it down to heap_form_tuple. Michael Paquier pointed out that pg_dump --verbose was missing a newline and Fabrízio de Royes Mello further pointed out that the schema was also missing from the messages, so fix those also. Also, based on an off-list comment from Kevin, rework the psql \d output to facilitate copy/pasting into a new CREATE or ALTER POLICY command. Lastly, improve the pg_policies view and update the documentation for it, along with a few other minor doc corrections based on an off-list discussion with Adam Brightwell. --- doc/src/sgml/catalogs.sgml | 91 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 89 insertions(+), 2 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml index a6ca290cb3d..f4617b67e95 100644 --- a/doc/src/sgml/catalogs.sgml +++ b/doc/src/sgml/catalogs.sgml @@ -5396,6 +5396,13 @@ The command type to which the row-security policy is applied. + + rsecroles + char + + The roles to which the row-security policy is applied. + + rsecqual pg_node_tree @@ -5417,8 +5424,8 @@ pg_class.relrowsecurity - True if the table has row-security enabled. - Must be true if the table has a row-security policy in this catalog. + True if the table has row-security enabled. Policies will not be applied + unless row-security is enabled on the table. @@ -7299,6 +7306,11 @@ materialized views + + pg_policies + policies + + pg_prepared_statements prepared statements @@ -8146,6 +8158,81 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx + + <structname>pg_policies</structname> + + + pg_policies + + + + The view pg_policies provides access to + useful information about each policy in the database. + + + + <structname>pg_policies</> Columns + + + + + Name + Type + References + Description + + + + + schemaname + name + pg_namespace.nspname + Name of schema containing table policy is on + + + tablename + name + pg_class.relname + Name of table policy is on + + + policyname + name + pg_class.relname + Name of policy + + + cmd + text + + The command type to which the policy is applied. + + + roles + name[] + + The roles to which this policy applies. + + + qual + text + + The expression added to the security barrier qualifications for + queries which this policy applies to. + + + with_check + text + + The expression added to the with check qualifications for + queries which attempt to add rows to this table. + + + +
+ +
+ <structname>pg_prepared_statements</structname> -- cgit v1.2.3