postgresql/src
Stephen Frost 7d8db3e8f3 Include policies based on ACLs needed
When considering which policies should be included, rather than look at
individual bits of the query (eg: if a RETURNING clause exists, or if a
WHERE clause exists which is referencing the table, or if it's a
FOR SHARE/UPDATE query), consider any case where we've determined
the user needs SELECT rights on the relation while doing an UPDATE or
DELETE to be a case where we apply SELECT policies, and any case where
we've deteremind that the user needs UPDATE rights on the relation while
doing a SELECT to be a case where we apply UPDATE policies.

This simplifies the logic and addresses concerns that a user could use
UPDATE or DELETE with a WHERE clauses to determine if rows exist, or
they could use SELECT .. FOR UPDATE to lock rows which they are not
actually allowed to modify through UPDATE policies.

Use list_append_unique() to avoid adding the same quals multiple times,
as, on balance, the cost of checking when adding the quals will almost
always be cheaper than keeping them and doing busywork for each tuple
during execution.

Back-patch to 9.5 where RLS was added.
2015-09-30 07:39:24 -04:00
..
backend Include policies based on ACLs needed 2015-09-30 07:39:24 -04:00
bin Fix incorrect tps number calculation in "excluding connections establishing". 2015-09-30 10:53:31 +09:00
common pgindent run for 9.5 2015-05-23 21:35:49 -04:00
include Code review for transaction commit timestamps 2015-09-29 14:40:56 -03:00
interfaces Fix poor errno handling in libpq's version of our custom OpenSSL BIO. 2015-09-28 18:02:38 -04:00
makefiles Remove support for Unix systems without the POSIX signal APIs. 2015-08-31 12:56:10 -04:00
pl Fix plperl to handle non-ASCII error message texts correctly. 2015-09-29 10:52:22 -04:00
port Remove support for Unix systems without the POSIX signal APIs. 2015-08-31 12:56:10 -04:00
template Attempt to work around a 32bit xlc compiler bug from a different place. 2015-08-08 01:19:02 +02:00
test Include policies based on ACLs needed 2015-09-30 07:39:24 -04:00
timezone Update time zone data files to tzdata release 2015d. 2015-05-15 19:35:29 -04:00
tools Rework the way multixact truncations work. 2015-09-26 19:04:25 +02:00
tutorial Remove no-longer-required function declarations. 2015-05-24 12:20:23 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
DEVELOPERS
Makefile Create libpgcommon, and move pg_malloc et al to it 2013-02-12 11:21:05 -03:00
Makefile.global.in Don't try to create a temp install without abs_top_builddir. 2015-09-28 10:49:59 -04:00
Makefile.shlib AIX: Link TRANSFORM modules with their dependencies. 2015-07-15 21:00:26 -04:00
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
nls-global.mk Setup error context callback for transaction lock waits 2014-03-19 15:10:36 -03:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00