<commit_before>CREATE OR REPLACE FUNCTION only_if_unmodified_since() RETURNS trigger AS $$
BEGIN
    IF NEW.modified_at >= OLD.modified_at THEN
        RETURN NEW;
    ELSE
        -- short circuit the update if the condition is not satisfied
        RAISE NOTICE 'Bypassing update. The current record is newer.';
        RETURN NULL;
    END IF;
END;
$$ LANGUAGE plpgsql;

DROP TRIGGER IF EXISTS poky_only_if_unmodified_since ON poky;
CREATE TRIGGER poky_only_if_unmodified_since
 BEFORE UPDATE ON poky
   FOR EACH ROW EXECUTE PROCEDURE only_if_unmodified_since();



-- upsert tuple while ensuring that the modified timestamp is >= than the current timestamp if the record exists.
-- Return values:
--  'inserted' on insert
--  'updated' on successful update
--  'rejected' when the modified at does not satisfy the >= condition<commit_msg>Removing the RAISE NOTICE on rejection.<commit_after>-- Ensure that we only accept updates to poky if the modified_at timestamp is
-- greater than or equal to the current modified_at.
CREATE OR REPLACE FUNCTION only_if_unmodified_since() RETURNS trigger AS $$
BEGIN
    IF NEW.modified_at >= OLD.modified_at THEN
        RETURN NEW;
    ELSE
        -- short circuit the update if the condition is not satisfied
        RETURN NULL;
    END IF;
END;
$$ LANGUAGE plpgsql;

DROP TRIGGER IF EXISTS poky_only_if_unmodified_since ON poky;
CREATE TRIGGER poky_only_if_unmodified_since
 BEFORE UPDATE ON poky
   FOR EACH ROW EXECUTE PROCEDURE only_if_unmodified_since();



-- upsert tuple while ensuring that the modified timestamp is >= than the current timestamp if the record exists.
-- Return values:
--  'inserted' on insert
--  'updated' on successful update
--  'rejected' when the modified at does not satisfy the >= condition
{'fraction_non_alphanumeric': 0.05819209039548023, 'fraction_numerical': 0.0, 'mean_word_length': 3.7101063829787235, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5686872', 'n_tokens_mistral': 535, 'n_tokens_neox': 509, 'n_words': 213}