Src |
CREATE FUNCTION "URX_PUBLIC"."_add_raster_constraint"(cn name, sql text)
RETURNS boolean AS
$BODY$
BEGIN
BEGIN
EXECUTE sql;
EXCEPTION
WHEN duplicate_object THEN
RAISE NOTICE 'The constraint "%" already exists. To replace the existing constraint, delete the constraint and call ApplyRasterConstraints again', cn;
WHEN OTHERS THEN
RAISE NOTICE 'Unable to add constraint: %', cn;
RAISE NOTICE 'SQL used for failed constraint: %', sql;
RAISE NOTICE 'Returned error message: % (%)', SQLERRM, SQLSTATE;
RETURN FALSE;
END;
RETURN TRUE;
END;
$BODY$
LANGUAGE 'plpgsql' VOLATILESTRICT ;
|