mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-05 18:19:21 +02:00
Previously, "GRANT foo TO bar" or "GRANT foo TO bar GRANTED BY baz" would record the OID of the grantor in pg_auth_members.grantor, but that role could later be dropped without modifying or removing the pg_auth_members record. That's not great, because we typically try to avoid dangling references in catalog data. Now, a role grant depends on the grantor, and the grantor can't be dropped without removing the grant or changing the grantor. "DROP OWNED BY" will remove the grant, just as it does for other kinds of privileges. "REASSIGN OWNED BY" will not, again just like what we do in other cases involving privileges. pg_auth_members now has an OID column, because that is needed in order for dependencies to work. It also now has an index on the grantor column, because otherwise dropping a role would require a sequential scan of the entire table to see whether the role's OID is in use as a grantor. That probably wouldn't be too large a problem in practice, but it seems better to have an index just in case. A follow-on patch is planned with the goal of more thoroughly rationalizing the behavior of role grants. This patch is just trying to do enough to make sure that the data we store in the catalogs is at some basic level valid. Patch by me, reviewed by Stephen Frost Discussion: http://postgr.es/m/CA+TgmoaFr-RZeQ+WoQ5nKPv97oT9+aDgK_a5+qWHSgbDsMp1Vg@mail.gmail.com |
||
---|---|---|
.. | ||
access | ||
backup | ||
bootstrap | ||
catalog | ||
commands | ||
common | ||
datatype | ||
executor | ||
fe_utils | ||
foreign | ||
jit | ||
lib | ||
libpq | ||
mb | ||
nodes | ||
optimizer | ||
parser | ||
partitioning | ||
port | ||
portability | ||
postmaster | ||
regex | ||
replication | ||
rewrite | ||
snowball | ||
statistics | ||
storage | ||
tcop | ||
tsearch | ||
utils | ||
.gitignore | ||
c.h | ||
fmgr.h | ||
funcapi.h | ||
getopt_long.h | ||
Makefile | ||
miscadmin.h | ||
pg_config_ext.h.in | ||
pg_config_manual.h | ||
pg_config.h.in | ||
pg_getopt.h | ||
pg_trace.h | ||
pgstat.h | ||
pgtar.h | ||
pgtime.h | ||
port.h | ||
postgres_ext.h | ||
postgres_fe.h | ||
postgres.h | ||
windowapi.h |