postgresql/contrib/pgstattuple
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
Makefile Remove superuser checks in pgstattuple 2016-09-29 22:13:38 -04:00
pgstatapprox.c Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
pgstatindex.c Add relkind checks to certain contrib modules 2017-03-09 16:34:25 -05:00
pgstattuple--1.0--1.1.sql
pgstattuple--1.1--1.2.sql
pgstattuple--1.2--1.3.sql Add pgstattuple_approx() to the pgstattuple extension. 2015-05-13 07:35:06 +02:00
pgstattuple--1.3--1.4.sql Update pgstattuple extension for parallel query. 2016-06-10 10:42:03 -04:00
pgstattuple--1.4--1.5.sql pgstattuple: Add pgstathashindex. 2017-02-03 14:37:16 -05:00
pgstattuple--1.4.sql Minor fixes in contrib installation scripts. 2016-06-14 10:47:06 -04:00
pgstattuple--unpackaged--1.0.sql Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:37 +02:00
pgstattuple.c Add relkind checks to certain contrib modules 2017-03-09 16:34:25 -05:00
pgstattuple.control Remove superuser checks in pgstattuple 2016-09-29 22:13:38 -04:00