       exception_id int;
       status_flag varchar;
       status_original_flag varchar;
+      listing_updated_at_flag varchar;
+      flags_to_reset text[];
     BEGIN
     SELECT id INTO deletion_id FROM change_types
       WHERE designation_id = designation.id AND name = 'DELETION';

          ELSE inherited_cites_status
        END,
        CASE
          WHEN (listing->'listing_updated_at')::TIMESTAMP IS NOT NULL
          THEN (listing->'listing_updated_at')::TIMESTAMP
          ELSE inherited_listing_updated_at
        END
        FROM    q

        (listing->status_original_flag)::BOOLEAN = 'f'
    )
    UPDATE taxon_concepts
    SET listing = COALESCE(listing, ''::HSTORE) ||
      hstore(status_flag, inherited_cites_status) ||
      hstore(status_original_flag, 'f') ||
      hstore('cites_NC', NULL) ||
      hstore(listing_updated_at_flag, inherited_listing_updated_at) ||
      hstore('listing_updated_at', inherited_listing_updated_at) --TODO get rid of this
    FROM q
    WHERE taxon_concepts.id = q.id AND (
      listing IS NULL OR
