postgresql/contrib/pg_visibility
Stephen Frost c08d82f38e Add relkind checks to certain contrib modules
The contrib extensions pageinspect, pg_visibility and pgstattuple only
work against regular relations which have storage.  They don't work
against foreign tables, partitioned (parent) tables, views, et al.

Add checks to the user-callable functions to return a useful error
message to the user if they mistakenly pass an invalid relation to a
function which doesn't accept that kind of relation.

In passing, improve some of the existing checks to use ereport() instead
of elog(), add a function to consolidate common checks where
appropriate, and add some regression tests.

Author: Amit Langote, with various changes by me
Reviewed by: Michael Paquier and Corey Huinker
Discussion: https://postgr.es/m/ab91fd9d-4751-ee77-c87b-4dd704c1e59c@lab.ntt.co.jp
2017-03-09 16:34:25 -05:00
..
expected Add relkind checks to certain contrib modules 2017-03-09 16:34:25 -05:00
sql Add relkind checks to certain contrib modules 2017-03-09 16:34:25 -05:00
.gitignore Add relkind checks to certain contrib modules 2017-03-09 16:34:25 -05:00
Makefile Add relkind checks to certain contrib modules 2017-03-09 16:34:25 -05:00
pg_visibility--1.0--1.1.sql pg_visibility: Add pg_truncate_visibility_map function. 2016-06-17 17:37:30 -04:00
pg_visibility--1.1.sql pg_visibility: Add pg_truncate_visibility_map function. 2016-06-17 17:37:30 -04:00
pg_visibility.c Add relkind checks to certain contrib modules 2017-03-09 16:34:25 -05:00
pg_visibility.control Add integrity-checking functions to pg_visibility. 2016-06-15 14:33:58 -04:00