Dean Rasheed's updatable s.b. views patch v3, amended

CAEZATCVAqJV5WTjLmyObP21n+CzhbEx2AOzH4e6qmTcueVDjdQ@mail.gmail.com

2014-01-23

plus fixes in 52E9E4D6.7070005@2ndquadrant.com
RLS: Make plan caching dependent on user ID.
RLS: add pg_rowsecurity catalog
RLS: Add rowsec_relid to ResultRelInfo

This hunk may still be needed in the new approach to filter out rows that've
changed to no longer be visible due to user action r action of triggers;
we'd need to filter the result relation.
RLS: Add ALTER TABLE commands for row security
RLS: pg_dump support for dumping rowsecurity catalogs
RLS: psql support for reporting row security constraints
RLS: Flag to ignore row-security in triggers
RLS: Add rowsec_done flag to RangeTblEntry

To be used to track completion status of row security expansion on a
range table entry. Rels with this flag set must not be row-security
expanded.
RLS: Enforce row-security constraints

Row-security constraints are enforced here by having the securityQual expansion
code check for a row-security constraint before expanding quals.
RLS: Regression tests
Only try to apply rowsecurity to relations
Ensure reliable ordering in results of regression tests
Invalid RLS plans on uid change, correctly test relkind