DO
$body$
DECLARE
   _con text := (
      SELECT tc.constraint_name
      FROM information_schema.table_constraints AS tc
      JOIN information_schema.key_column_usage AS kcu
      ON tc.constraint_name = kcu.constraint_name
      AND tc.table_schema = kcu.table_schema
      WHERE constraint_type = 'UNIQUE' AND kcu.column_name='keyword'
      AND tc.table_name = 'tm_object_attribute'
      );

BEGIN
   EXECUTE '
      ALTER TABLE tm_object_attribute DROP CONSTRAINT ' || _con;
END
$body$;
