On Mon, Aug 13, 2018 at 12:21:42AM +0200, Michael Paquier wrote:
> The patch attached includes tests which I have used to also check that
> correct error messages are produced for VACUUM, VACUUM ANALYZE and
> ANALYZE.
I have reworked the patch on this side, clarifying the use of the new
common API for the logs. One thing I am wondering about is what do we
want to do when VACUUM ANALYZE is used. As of HEAD, if vacuum_rel()
stops, then analyze_rel() is never called, and the only log showing up
to a non-owner user would be:
skipping "foo" --- only superuser can vacuum it
With this patch, things become perhaps more confusing by generating two
WARNING log entries:
skipping "foo" --- only superuser can vacuum it
skipping "foo" --- only superuser can analyze it
We could either combine both in a single message, or just generate the
message for vacuum as HEAD does now. I have also added some simple
regression tests triggering the skipping logs for shared catalogs,
non-shared catalogs and non-owners. This could be a separate patch as
well.
Input is welcome.
--
Michael