<commit_before>Add MongoDB ObjectID to rows in Postgres
========================================

## Postgres Trigger Functions

### Functon Definition

Remember to alter `tbl_name` and `tbl_id` accordingly.

```plpgsql
CREATE OR REPLACE FUNCTION tbl_name_notify_trigger() RETURNS trigger AS $$
DECLARE
BEGIN
  PERFORM pg_notify('watchers', TG_TABLE_NAME || ',tbl_id,' || NEW.tbl_id );
  RETURN NEW;
END;
$$ LANGUAGE plpgsql;
```

### Add as Trigger

```plpgsql
CREATE TRIGGER tbl_name_watch_trigger AFTER INSERT ON tbl_name
FOR EACH ROW EXECUTE PROCEDURE tbl_name_notify_trigger();
```
<commit_msg>Update wording for postgres setup<commit_after>Add MongoDB ObjectID to rows in Postgres
========================================

## Postgres Trigger Functions

Remember to alter all instances of `tbl_name` and `tbl_id` accordingly.

### Create Postgres Functon Definition


```plpgsql
CREATE OR REPLACE FUNCTION tbl_name_notify_trigger() RETURNS trigger AS $$
DECLARE
BEGIN
  PERFORM pg_notify('watchers', TG_TABLE_NAME || ',tbl_id,' || NEW.tbl_id );
  RETURN NEW;
END;
$$ LANGUAGE plpgsql;
```

### Add Functon as Trigger

```plpgsql
CREATE TRIGGER tbl_name_watch_trigger AFTER INSERT ON tbl_name
FOR EACH ROW EXECUTE PROCEDURE tbl_name_notify_trigger();
```

{'fraction_non_alphanumeric': 0.15079365079365079, 'fraction_numerical': 0.0, 'mean_word_length': 6.3313953488372094, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3121976', 'n_tokens_mistral': 441, 'n_tokens_neox': 398, 'n_words': 124}