Add support for restrictive RLS policies

Stephen Frost <sfrost@snowman.net>

From: Stephen Frost <sfrost@snowman.net>
To: pgsql-hackers@postgresql.org
Date: 2016-09-01T06:34:04Z
Lists: pgsql-hackers

Attachments

Greetings,

As outlined in the commit message, this adds support for restrictive RLS
policies.  We've had this in the backend since 9.5, but they were only
available via hooks and therefore extensions.  This adds support for
them to be configured through regular DDL commands.  These policies are,
essentially "AND"d instead of "OR"d.

Includes updates to the catalog, grammer, psql, pg_dump, and regression
tests.  Documentation will be added soon, but until then, would be great
to get feedback on the grammer, catalog and code changes.

Thanks!

Stephen

Commits

  1. Add support for restrictive RLS policies

  2. Include <sys/select.h> where needed

  3. Apply table and domain CHECK constraints in name order.