[postgis-tickets] [PostGIS] #2361: [raster] Add index flag column to raster_columns
PostGIS
trac at osgeo.org
Fri Jun 14 16:51:44 PDT 2013
#2361: [raster] Add index flag column to raster_columns
-------------------------+--------------------------------------------------
Reporter: dustymugs | Owner: dustymugs
Type: enhancement | Status: new
Priority: medium | Milestone: PostGIS Future
Component: raster | Version: trunk
Keywords: |
-------------------------+--------------------------------------------------
Add column to raster_columns view indicating if a raster column has an
index...
The following query should be a decent starting point...
{{{
SELECT
n.nspname AS "schema",
c2.relname AS "table",
c.relname AS "index",
att.attname AS "column"
FROM pg_catalog.pg_class c
JOIN pg_catalog.pg_index i
ON i.indexrelid = c.oid
JOIN pg_catalog.pg_class c2
ON i.indrelid = c2.oid
JOIN pg_catalog.pg_namespace n
ON n.oid = c.relnamespace
JOIN pg_am am
ON c.relam = am.oid
JOIN pg_attribute att
ON att.attrelid = c2.oid
AND pg_catalog.format_type(att.atttypid, att.atttypmod) =
'raster'
WHERE c.relkind IN ('i')
AND n.nspname NOT IN ('pg_catalog', 'pg_toast')
AND n.nspname = 'tops'
AND am.amname = 'gist'
AND strpos(split_part(pg_catalog.pg_get_indexdef(i.indexrelid, 0,
true), ' gist ', 2), att.attname) > 0
ORDER BY 1,2,3;
}}}
--
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2361>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.
More information about the postgis-tickets
mailing list