postgresql/src/include
Stephen Frost 6550b901fe Code review for row security.
Buildfarm member tick identified an issue where the policies in the
relcache for a relation were were being replaced underneath a running
query, leading to segfaults while processing the policies to be added
to a query.  Similar to how TupleDesc RuleLocks are handled, add in a
equalRSDesc() function to check if the policies have actually changed
and, if not, swap back the rsdesc field (using the original instead of
the temporairly built one; the whole structure is swapped and then
specific fields swapped back).  This now passes a CLOBBER_CACHE_ALWAYS
for me and should resolve the buildfarm error.

In addition to addressing this, add a new chapter in Data Definition
under Privileges which explains row security and provides examples of
its usage, change \d to always list policies (even if row security is
disabled- but note that it is disabled, or enabled with no policies),
rework check_role_for_policy (it really didn't need the entire policy,
but it did need to be using has_privs_of_role()), and change the field
in pg_class to relrowsecurity from relhasrowsecurity, based on
Heikki's suggestion.  Also from Heikki, only issue SET ROW_SECURITY in
pg_restore when talking to a 9.5+ server, list Bypass RLS in \du, and
document --enable-row-security options for pg_dump and pg_restore.

Lastly, fix a number of minor whitespace and typo issues from Heikki,
Dimitri, add a missing #include, per Peter E, fix a few minor
variable-assigned-but-not-used and resource leak issues from Coverity
and add tab completion for role attribute bypassrls as well.
2014-09-24 16:32:22 -04:00
..
access Improve code around the recently added rm_identify rmgr callback. 2014-09-22 17:49:34 +02:00
bootstrap Add some noreturn attributes based on compiler recommendations 2014-08-13 22:40:48 -04:00
catalog Code review for row security. 2014-09-24 16:32:22 -04:00
commands Code review for row security. 2014-09-24 16:32:22 -04:00
common pgindent run for 9.4 2014-05-06 12:12:18 -04:00
datatype pgindent run for 9.4 2014-05-06 12:12:18 -04:00
executor Pack tuples in a hash join batch densely, to save memory. 2014-09-10 21:24:52 +03:00
foreign Implement IMPORT FOREIGN SCHEMA. 2014-07-10 15:01:43 -04:00
lib pgindent run for 9.4 2014-05-06 12:12:18 -04:00
libpq Break out OpenSSL-specific code to separate files. 2014-08-11 11:54:19 +03:00
mb pgindent run for 9.4 2014-05-06 12:12:18 -04:00
nodes Row-Level Security Policies (RLS) 2014-09-19 11:18:35 -04:00
optimizer Row-Level Security Policies (RLS) 2014-09-19 11:18:35 -04:00
parser Row-Level Security Policies (RLS) 2014-09-19 11:18:35 -04:00
port Remove Alpha and Tru64 support. 2014-06-28 21:46:15 +02:00
portability pgindent run for 9.4 2014-05-06 12:12:18 -04:00
postmaster Add some noreturn attributes based on compiler recommendations 2014-08-13 22:40:48 -04:00
regex pgindent run for 9.4 2014-05-06 12:12:18 -04:00
replication Add GUC to enable logging of replication commands. 2014-09-13 02:55:45 +09:00
rewrite Row-Level Security Policies (RLS) 2014-09-19 11:18:35 -04:00
snowball pgindent run for 9.4 2014-05-06 12:12:18 -04:00
storage Mark x86's memory barrier inline assembly as clobbering the cpu flags. 2014-09-19 17:04:00 +02:00
tcop pgindent run for 9.4 2014-05-06 12:12:18 -04:00
tsearch Allow opclasses to provide tri-valued GIN consistent functions. 2014-03-12 17:51:30 +02:00
utils Row-Level Security Policies (RLS) 2014-09-19 11:18:35 -04:00
.gitignore Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
c.h Add #define INT64_MODIFIER for the printf length modifier for 64-bit ints. 2014-08-21 09:56:44 +03:00
fmgr.h Add PG_RETURN_UINT16 macro. 2014-08-06 16:11:43 -04:00
funcapi.h pgindent run for 9.4 2014-05-06 12:12:18 -04:00
getaddrinfo.h Fix assorted issues in client host name lookup. 2014-04-02 17:11:24 -04:00
getopt_long.h Add support for optional_argument to our own getopt_long() implementation. 2014-09-10 17:21:50 +02:00
Makefile Remove maintainer-check target, fold into normal build 2013-10-10 20:11:56 -04:00
miscadmin.h Row-Level Security Policies (RLS) 2014-09-19 11:18:35 -04:00
pg_config_ext.h.in Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_ext.h.win32 Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_manual.h Break out OpenSSL-specific code to separate files. 2014-08-11 11:54:19 +03:00
pg_config.h.in Add #define INT64_MODIFIER for the printf length modifier for 64-bit ints. 2014-08-21 09:56:44 +03:00
pg_config.h.win32 Add #define INT64_MODIFIER for the printf length modifier for 64-bit ints. 2014-08-21 09:56:44 +03:00
pg_getopt.h Fix comment. 2014-05-08 12:42:56 -04:00
pg_trace.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
pgstat.h Save pg_stat_statements statistics file into $PGDATA/pg_stat directory at shutdown. 2014-06-04 12:09:45 +09:00
pgtar.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
pgtime.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
port.h Detect presence of SSL_get_current_compression 2014-07-15 18:07:03 +02:00
postgres_ext.h pgindent run for 9.4 2014-05-06 12:12:18 -04:00
postgres_fe.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
postgres.h Fix typos in comments. 2014-07-07 19:39:42 +09:00
rusagestub.h Update copyright for 2014 2014-01-07 16:05:30 -05:00
windowapi.h Update copyright for 2014 2014-01-07 16:05:30 -05:00