postgresql
postgresql copied to clipboard
Change default for postgresql_row_security to "on".
This PR changes the postgresql.conf row_security setting to 'on'.
WHY: The default installs of PostgreSQL after 9.5 from the PostgreSQL repositories all have row_security defaulting to on. This is also the case with the EnterpriseDB installers. Changing this to off can cause unexpected issues that are hard to track down if you're not aware that the defaults have been changed. There doesn't seem to be any benefits to keeping it off either.
To be clear, changing this to on doesn't mean that all your tables now have row level security (RLS) it merely means that row level security will function if you turn it on for a given table.
As it is now, for PostgreSQL instances installed with this role, if you turn on RLS for a given table and institute a RLS policy for that table when you try to use it you will get an error. (ERROR: query would be affected by row-level security policy for table "table_name"). This error doesn't make it clear that the issue isn't your policy settings but the overall row_security GUC.
I'm available to discuss if anyone has questions.
@arenius , what did you think of my suggestion on how to keep the default to "off" for pre v9.5? I've just noticed a small bug, as the vars/postgresql-9.5.yml
isn't needed... because that's when the default changed to "on"
This pr has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!