biblio.monograph_part

Soft Deletes: This table uses a deleted boolean flag rather than physical row deletion. Ad-hoc queries must include WHERE deleted = false to exclude logically-deleted rows. The application layer enforces this automatically; direct SQL does not.

Data-Modifying Triggers: This table has BEFORE ROW trigger(s) that modify row data before write. Values you INSERT or UPDATE may differ from what is actually stored. See the Triggers section below.

Columns

Column Type Nullable Default Notes

id PK

integer

No

nextval('biblio.monograph_part_id_seq'::regclass)

record FK

bigint

No

biblio.record_entry(id)

label

text

No

label_sortkey

text

No

deleted SOFT-DEL

boolean

No

false

creator

integer

No

1

create_date

timestamp with time zone

No

now()

editor

integer

No

1

edit_date

timestamp with time zone

No

now()

Primary Key

(id)

Foreign Keys

Column(s) References On Delete On Update Deferrable Constraint

record

biblio.record_entry(id)

NO ACTION

NO ACTION

No

monograph_part_record_fkey

Indexes

Index Method Definition

monograph_part_pkey PK

btree

CREATE UNIQUE INDEX monograph_part_pkey ON biblio.monograph_part USING btree (id)

record_label_unique_idx UNIQUE

btree

CREATE UNIQUE INDEX record_label_unique_idx ON biblio.monograph_part USING btree (record, label) WHERE (deleted = false)

Triggers

Trigger Timing Event Level Function

norm_sort_label

BEFORE

INSERT OR UPDATE

ROW

biblio.normalize_biblio_monograph_part_sortkey()

Trigger Bodies

norm_sort_label

Function: biblio.normalize_biblio_monograph_part_sortkey()
Timing: BEFORE INSERT OR UPDATE ROW

This trigger modifies the row before it is written (returns a modified NEW).

BEGIN
    NEW.label_sortkey := REGEXP_REPLACE(
        evergreen.lpad_number_substrings(
            naco_normalize(NEW.label),
            '0',
            10
        ),
        E'\\s+',
        '',
        'g'
    );
    RETURN NEW;
END;

Referenced By

The following tables have foreign keys pointing to biblio.monograph_part (1 referencing table(s)):

Table Referencing Column(s) Referenced Column(s) Constraint

asset.copy_part_map

part

id

copy_part_map_part_fkey