pg_visibility: Restrict access to more relation types

Temporary relations of other sessions have their own local pages.
Temporary and unlogged relations have no storage during recovery.
pg_visibility did not check for either cases, leading to inconsistent
results or confusing error messages, like some "ERROR: could not open
file".

This commit adds checks for both cases, so as a clean errors are
returned instead of the previous mix of incorrect results or errors,
depending on the function called and the relation whose information is
requested.

Author: Jim Jones <[email protected]>
Reported-by: Zsolt Parragi <[email protected]>
Reviewed-by: Kirill Reshke <[email protected]>
Reviewed-by: Michael Paquier <[email protected]>
Reviewed-by: Surya Poondla <[email protected]>
Discussion: 
https://postgr.es/m/[email protected]

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1ed083f90d29871b21d5b3d2351accf4a0d9ca81

Modified Files
--------------
contrib/pg_visibility/pg_visibility.c | 31 +++++++++++++++++++++----------
1 file changed, 21 insertions(+), 10 deletions(-)

Reply via email to