URX_PUBLIC._raster_constraint_info_spatially_unique(rastschema name, rasttable name, rastcolumn name) - Procedure
Home|Tables|Schemas|Diagrams|Foreign Keys|Indexes

NameURX_PUBLIC._raster_constraint_info_spatially_unique(rastschema name, rasttable name, rastcolumn name)
Comment
Src
CREATE FUNCTION "URX_PUBLIC"."_raster_constraint_info_spatially_unique"(rastschema name, rasttable name, rastcolumn name) 
 RETURNS boolean AS 
$BODY$
	SELECT
		TRUE
	FROM pg_class c, pg_namespace n, pg_attribute a, pg_constraint s, pg_index idx, pg_operator op
	WHERE n.nspname = $1
		AND c.relname = $2
		AND a.attname = $3
		AND a.attrelid = c.oid
		AND s.connamespace = n.oid
		AND s.conrelid = c.oid
		AND s.contype = 'x'
		AND 0::smallint = ANY (s.conkey)
		AND idx.indexrelid = s.conindid
		AND pg_get_indexdef(idx.indexrelid, 1, true) LIKE '(' || quote_ident($3) || '::geometry)'
		AND s.conexclop[1] = op.oid
		AND op.oprname = '=';
	$BODY$
 LANGUAGE 'sql' STABLESTRICT ;