From: Regina Obe Date: Sat, 27 May 2017 17:07:42 +0000 (+0000) Subject: List parent partition tables and have geography_view only list things like tables... X-Git-Tag: 2.4.0alpha~85 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4a45643e9a5dc16ae135f1e71f31696ee2b1c1e7;p=postgis List parent partition tables and have geography_view only list things like tables (exclude helper types) Closes #3766 git-svn-id: http://svn.osgeo.org/postgis/trunk@15409 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/postgis/geography.sql.in b/postgis/geography.sql.in index 36a21555b..5d27cc30d 100644 --- a/postgis/geography.sql.in +++ b/postgis/geography.sql.in @@ -147,6 +147,7 @@ CREATE OR REPLACE FUNCTION postgis_typmod_type(integer) LANGUAGE 'c' IMMUTABLE STRICT _PARALLEL; -- Availability: 1.5.0 +-- Changed: 2.4.0 Limit to only list things that are tables CREATE OR REPLACE VIEW geography_columns AS SELECT current_database() AS f_table_catalog, @@ -162,12 +163,13 @@ CREATE OR REPLACE VIEW geography_columns AS pg_type t, pg_namespace n WHERE t.typname = 'geography' - AND a.attisdropped = false - AND a.atttypid = t.oid - AND a.attrelid = c.oid - AND c.relnamespace = n.oid - AND NOT pg_is_other_temp_schema(c.relnamespace) - AND has_table_privilege( c.oid, 'SELECT'::text ); + AND a.attisdropped = false + AND a.atttypid = t.oid + AND a.attrelid = c.oid + AND c.relnamespace = n.oid + AND c.relkind = ANY (ARRAY['r'::"char", 'v'::"char", 'm'::"char", 'f'::"char", 'p'::"char"] ) + AND NOT pg_is_other_temp_schema(c.relnamespace) + AND has_table_privilege( c.oid, 'SELECT'::text ); -- Availability: 1.5.0 CREATE OR REPLACE FUNCTION geography(geometry) diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in index 67c53dfde..90a5900a5 100644 --- a/postgis/postgis.sql.in +++ b/postgis/postgis.sql.in @@ -5433,7 +5433,8 @@ LANGUAGE 'sql' STABLE STRICT _PARALLEL; -- Availability: 2.0.0 -- Changed: 2.1.8 significant performance improvement for constraint based columns --- Changed: 2.2.0 get rid of scheman, table, column cast to improve performance +-- Changed: 2.2.0 get rid of schema, table, column cast to improve performance +-- Changed: 2.4.0 List also Parent partitioned tables CREATE OR REPLACE VIEW geometry_columns AS SELECT current_database()::character varying(256) AS f_table_catalog, n.nspname AS f_table_schema, @@ -5467,7 +5468,7 @@ CREATE OR REPLACE VIEW geometry_columns AS WHERE s.consrc ~~* '%srid(% = %'::text ) sr ON sr.connamespace = n.oid AND sr.conrelid = c.oid AND (a.attnum = ANY (sr.conkey)) - WHERE (c.relkind = ANY (ARRAY['r'::"char", 'v'::"char", 'm'::"char", 'f'::"char"])) + WHERE (c.relkind = ANY (ARRAY['r'::"char", 'v'::"char", 'm'::"char", 'f'::"char", 'p'::"char"])) AND NOT c.relname = 'raster_columns'::name AND t.typname = 'geometry'::name AND NOT pg_is_other_temp_schema(c.relnamespace) AND has_table_privilege(c.oid, 'SELECT'::text); diff --git a/raster/rt_pg/rtpostgis.sql.in b/raster/rt_pg/rtpostgis.sql.in index 480345cfd..e88c2e343 100644 --- a/raster/rt_pg/rtpostgis.sql.in +++ b/raster/rt_pg/rtpostgis.sql.in @@ -8250,6 +8250,7 @@ CREATE OR REPLACE FUNCTION DropRasterConstraints ( ------------------------------------------------------------------------------ -- Availability: 2.0.0 -- Changed: 2.2.0 +-- Changed: 2.4.0 List partitioned parent tables CREATE OR REPLACE VIEW raster_columns AS SELECT current_database() AS r_table_catalog, @@ -8279,7 +8280,7 @@ CREATE OR REPLACE VIEW raster_columns AS AND a.atttypid = t.oid AND a.attrelid = c.oid AND c.relnamespace = n.oid - AND c.relkind = ANY(ARRAY['r'::char, 'v'::char, 'm'::char, 'f'::char]) + AND c.relkind = ANY (ARRAY['r'::"char", 'v'::"char", 'm'::"char", 'f'::"char", 'p'::"char"] ) AND NOT pg_is_other_temp_schema(c.relnamespace) AND has_table_privilege(c.oid, 'SELECT'::text); ------------------------------------------------------------------------------